diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-31 08:13:19 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-31 20:28:09 +0930 |
commit | 26e3de8e0a2d95e02b9dec46c67531755303fc4b (patch) | |
tree | 33f646b1422006ab4da81bd74bbd7c3ae6b62267 /gas/config/tc-z80.c | |
parent | 8f383897b69c58e02bc447b3c0813361f04bdc1e (diff) | |
download | gdb-26e3de8e0a2d95e02b9dec46c67531755303fc4b.zip gdb-26e3de8e0a2d95e02b9dec46c67531755303fc4b.tar.gz gdb-26e3de8e0a2d95e02b9dec46c67531755303fc4b.tar.bz2 |
PR26509 UBSAN: tc-z80.c:3656 shift exponent is too large
PR 26509
* config/tc-z80.c (is_overflow): Use 1UL in mask shift expression.
Diffstat (limited to 'gas/config/tc-z80.c')
-rw-r--r-- | gas/config/tc-z80.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index 237425d..45fcd6f 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -3653,7 +3653,7 @@ md_assemble (char *str) static int is_overflow (long value, unsigned bitsize) { - long fieldmask = (1 << bitsize) - 1; + long fieldmask = (1UL << bitsize) - 1; long signmask = ~fieldmask; long a = value & fieldmask; long ss = a & signmask; |