forked from Imagelibrary/binutils-gdb
ubsan: tc-z80.c:3656 shift exponent 32 is too large
* config/tc-z80.c (is_overflow): Avoid too large shift.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2020-09-02 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* config/tc-z80.c (is_overflow): Avoid too large shift.
|
||||
|
||||
2020-09-02 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* config/tc-sparc.c (in_signed_range): Use an unsigned type for
|
||||
|
||||
@@ -3653,7 +3653,7 @@ md_assemble (char *str)
|
||||
static int
|
||||
is_overflow (long value, unsigned bitsize)
|
||||
{
|
||||
long fieldmask = (1UL << bitsize) - 1;
|
||||
long fieldmask = (2UL << (bitsize - 1)) - 1;
|
||||
long signmask = ~fieldmask;
|
||||
long a = value & fieldmask;
|
||||
long ss = a & signmask;
|
||||
|
||||
Reference in New Issue
Block a user