diff options
author | Alan Modra <amodra@gmail.com> | 2024-12-16 18:10:10 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-12-16 19:37:40 +1030 |
commit | bc7b21018e0721de7eefec04a11ff7f82dce1e82 (patch) | |
tree | 2faea8394b40b04e94ae468c1a6656af1c55d378 /bfd/mach-o.c | |
parent | 64a91215cd9572fb8f049eb59ec2e2359b9dd7dc (diff) | |
download | gdb-bc7b21018e0721de7eefec04a11ff7f82dce1e82.zip gdb-bc7b21018e0721de7eefec04a11ff7f82dce1e82.tar.gz gdb-bc7b21018e0721de7eefec04a11ff7f82dce1e82.tar.bz2 |
mach-o segment section count assertion
Add an assertion that verifies we have filled the mdata->sections
array in bfd_mach_o_flatten_sections.
Diffstat (limited to 'bfd/mach-o.c')
-rw-r--r-- | bfd/mach-o.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/mach-o.c b/bfd/mach-o.c index 9ec5cab..8d5ca9b 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -5076,7 +5076,7 @@ bfd_mach_o_flatten_sections (bfd *abfd) { bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); bfd_mach_o_load_command *cmd; - long csect = 0; + unsigned long csect; size_t amt; /* Count total number of sections. */ @@ -5120,6 +5120,7 @@ bfd_mach_o_flatten_sections (bfd *abfd) mdata->sections[csect++] = sec; } } + BFD_ASSERT (mdata->nsects == csect); return true; } |