gcc 14.2.1-3 lax on signed-vs-unsigned compare

modified:   p_lx_elf.cpp
This commit is contained in:
John Reiser 2025-07-25 07:14:33 -07:00 committed by Markus F.X.J. Oberhumer
parent b52d3e0772
commit bbb886ae4d

View File

@ -8678,7 +8678,7 @@ Elf32_Sym const *PackLinuxElf32::elf_lookup(char const *name) const
if (l_sym <= &dynsym[n_visit++])
throwCantPack("circular DT_HASH chain %d\n", si);
// Detect next si out-of-bounds
if (((unsigned int const *)EOM - chains) <= si)
if ((unsigned)((unsigned int const *)EOM - chains) <= si)
throwCantPack("bad DT_HASH chain %d\n", si);
}
}
@ -8783,7 +8783,7 @@ Elf64_Sym const *PackLinuxElf64::elf_lookup(char const *name) const
if (l_sym <= &dynsym[n_visit++])
throwCantPack("circular DT_HASH chain %d\n", si);
// Detect next si out-of-bounds
if (((unsigned int const *)EOM - chains) <= si)
if ((unsigned)((unsigned int const *)EOM - chains) <= si)
throwCantPack("bad DT_HASH chain %d\n", si);
}
}