mirror of
git://sourceware.org/git/libabigail.git
synced 2025-01-22 17:23:05 +00:00
writer: fix off-by-one error in assertion
* src/abg-writer.cc (write_array_subrange_type): Fix off-by-one error in assertion. * src/abg-dwarf-reader.cc (build_subrange_type): Assert the length of the array complies with its bounds. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
0a5f056393
commit
bbdf7e0f29
@ -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);
|
||||
|
||||
|
@ -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() << "'";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user