diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index c2eb17d4..fd1372a3 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -14889,6 +14889,11 @@ build_subrange_type(read_context& ctxt, if (underlying_type) result->set_underlying_type(underlying_type); + ABG_ASSERT(result->is_infinite() + || (result->get_length() == + (uint64_t) (result->get_upper_bound() + - result->get_lower_bound() + 1))); + if (associate_type_to_die) ctxt.associate_die_to_type(die, result, where_offset); diff --git a/src/abg-writer.cc b/src/abg-writer.cc index d9153e09..216ca156 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -2788,7 +2788,7 @@ write_array_subrange_type(const array_type_def::subrange_sptr& decl, ABG_ASSERT(decl->is_infinite() || (decl->get_length() == (uint64_t) (decl->get_upper_bound() - - decl->get_lower_bound()))); + - decl->get_lower_bound() + 1))); o << " lower-bound='" << decl->get_lower_bound() << "' upper-bound='" << decl->get_upper_bound() << "'"; }