From: Alan Modra Date: Sun, 30 Aug 2020 22:43:19 +0000 (+0930) Subject: PR26509 UBSAN: tc-z80.c:3656 shift exponent is too large X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=26e3de8e0a2d95e02b9dec46c67531755303fc4b;p=binutils-gdb.git 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. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 757a3118c6e..16e425b371c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2020-08-31 Alan Modra + + PR 26509 + * config/tc-z80.c (is_overflow): Use 1UL in mask shift expression. + 2020-08-30 Alan Modra * config/tc-tic4x.c (tic4x_gen_to_words): Rewrite mantissa diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index 237425da354..45fcd6fbf74 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;