From: Alan Modra Date: Wed, 2 Sep 2020 00:52:39 +0000 (+0930) Subject: ubsan: tc-nios2.c:1403 shift exponent 32 is too large X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1929210d46cdf331fce175f0c4124777c0b12d18;p=binutils-gdb.git ubsan: tc-nios2.c:1403 shift exponent 32 is too large * config/tc-nios2.c (md_apply_fix): Avoid too large shift. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index fece8b59412..b6bc2099cd7 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2020-09-02 Alan Modra + + * config/tc-nios2.c (md_apply_fix): Avoid too large shift. + 2020-09-02 Alan Modra * config/tc-mips.c (load_register): Avoid too large shift. diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c index 0134b15ae08..5f0033a9f0c 100644 --- a/gas/config/tc-nios2.c +++ b/gas/config/tc-nios2.c @@ -1400,7 +1400,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) break; default: { - fixup &= ((valueT) 1 << howto->bitsize) - 1; + fixup &= ((valueT) 2 << (howto->bitsize - 1)) - 1; break; } }