mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 23:23:09 +00:00
mach-o segment section count assertion
Add an assertion that verifies we have filled the mdata->sections array in bfd_mach_o_flatten_sections.
This commit is contained in:
@@ -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_data_struct *mdata = bfd_mach_o_get_data (abfd);
|
||||||
bfd_mach_o_load_command *cmd;
|
bfd_mach_o_load_command *cmd;
|
||||||
long csect = 0;
|
unsigned long csect;
|
||||||
size_t amt;
|
size_t amt;
|
||||||
|
|
||||||
/* Count total number of sections. */
|
/* Count total number of sections. */
|
||||||
@@ -5120,6 +5120,7 @@ bfd_mach_o_flatten_sections (bfd *abfd)
|
|||||||
mdata->sections[csect++] = sec;
|
mdata->sections[csect++] = sec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BFD_ASSERT (mdata->nsects == csect);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user