mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 15:15:42 +00:00
Fix for -Wstringop-overflow false positive
the way the overflow check was written wasn't understood by some GCC versions and produced false positives for the memset call being called potentially with object sizes that are larger than half address-space.
This commit is contained in:
@@ -181,9 +181,9 @@ sec_merge_maybe_resize (struct sec_merge_hash *table, unsigned added)
|
||||
|
||||
do
|
||||
{
|
||||
newnb *= 2;
|
||||
if (!(unsigned int)newnb)
|
||||
if (newnb >> (8 * sizeof(mapofs_type) - 1))
|
||||
return false;
|
||||
newnb *= 2;
|
||||
}
|
||||
while (NEEDS_RESIZE (bfdtab->count + added, newnb));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user