ubsan: arc: shift exponent 32 is too large for 32-bit type 'int'
When operand->bits is 32, the following results in UB. value = (insn >> operand->shift) & ((1 << operand->bits) - 1); * arc-dis.c (find_format_from_table): Use ull constant when shifting by up to 32.
This commit is contained in:
parent
9d48687b41
commit
a11db3e9f3
@ -1,3 +1,8 @@
|
||||
2019-12-11 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* arc-dis.c (find_format_from_table): Use ull constant when
|
||||
shifting by up to 32.
|
||||
|
||||
2019-12-11 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 25270
|
||||
|
@ -295,7 +295,7 @@ find_format_from_table (struct disassemble_info *info,
|
||||
if (operand->extract)
|
||||
value = (*operand->extract) (insn, &invalid);
|
||||
else
|
||||
value = (insn >> operand->shift) & ((1 << operand->bits) - 1);
|
||||
value = (insn >> operand->shift) & ((1ull << operand->bits) - 1);
|
||||
|
||||
/* Check for LIMM indicator. If it is there, then make sure
|
||||
we pick the right format. */
|
||||
|
Loading…
Reference in New Issue
Block a user