ubsan: visium: left shift cannot be represented in type 'int'

* visium-dis.c (print_insn_visium): Avoid signed overflow.
This commit is contained in:
Alan Modra 2019-12-17 23:11:02 +10:30
parent 29298bf66f
commit eb7b504651
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2019-12-17 Alan Modra <amodra@gmail.com>
* visium-dis.c (print_insn_visium): Avoid signed overflow.
2019-12-17 Alan Modra <amodra@gmail.com>
* aarch64-opc.c (value_fit_signed_field_p): Avoid signed overflow.

View File

@ -789,7 +789,7 @@ print_insn_visium (bfd_vma addr, disassemble_info *info)
/* Get 32-bit instruction word. */
FETCH_DATA (info, buffer + 4);
ins = buffer[0] << 24;
ins = (unsigned) buffer[0] << 24;
ins |= buffer[1] << 16;
ins |= buffer[2] << 8;
ins |= buffer[3];