mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 18:14:13 +08:00
PR26498 UBSAN: elf32-spu.c:2292 left shift overflow
PR 26498 * elf32-spu.c (find_function_stack_adjust): Use unsigned vars to avoid UB left shift.
This commit is contained in:
parent
9e51d549d7
commit
2d0ce6779c
@ -1,3 +1,9 @@
|
||||
2020-08-26 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 26498
|
||||
* elf32-spu.c (find_function_stack_adjust): Use unsigned vars to
|
||||
avoid UB left shift.
|
||||
|
||||
2020-08-26 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 26484
|
||||
|
@ -2209,14 +2209,14 @@ find_function_stack_adjust (asection *sec,
|
||||
bfd_vma *lr_store,
|
||||
bfd_vma *sp_adjust)
|
||||
{
|
||||
int reg[128];
|
||||
int32_t reg[128];
|
||||
|
||||
memset (reg, 0, sizeof (reg));
|
||||
for ( ; offset + 4 <= sec->size; offset += 4)
|
||||
{
|
||||
unsigned char buf[4];
|
||||
int rt, ra;
|
||||
int imm;
|
||||
uint32_t imm;
|
||||
|
||||
/* Assume no relocs on stack adjusing insns. */
|
||||
if (!bfd_get_section_contents (sec->owner, sec, buf, offset, 4))
|
||||
|
Loading…
Reference in New Issue
Block a user