diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-26 20:02:07 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-26 23:23:45 +0930 |
commit | 2d0ce6779c25fb28b3b35cee02871b9a8d4cd29b (patch) | |
tree | 01afc767e045f3c7aff380adb2a9abc229c95867 /bfd/elf32-spu.c | |
parent | 9e51d549d7901be8b999f8dac86c5efd6a7edef2 (diff) | |
download | gdb-2d0ce6779c25fb28b3b35cee02871b9a8d4cd29b.zip gdb-2d0ce6779c25fb28b3b35cee02871b9a8d4cd29b.tar.gz gdb-2d0ce6779c25fb28b3b35cee02871b9a8d4cd29b.tar.bz2 |
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.
Diffstat (limited to 'bfd/elf32-spu.c')
-rw-r--r-- | bfd/elf32-spu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c index 13cff2c..167b90d 100644 --- a/bfd/elf32-spu.c +++ b/bfd/elf32-spu.c @@ -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)) |