ubsan: tc-nios2.c:1403 shift exponent 32 is too large
authorAlan Modra <amodra@gmail.com>
Wed, 2 Sep 2020 00:52:39 +0000 (10:22 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 2 Sep 2020 07:00:43 +0000 (16:30 +0930)
* config/tc-nios2.c (md_apply_fix): Avoid too large shift.

gas/ChangeLog
gas/config/tc-nios2.c

index fece8b594120e4bfa1b1b03b977dcbddc10bfd76..b6bc2099cd7987c0de0f1f6b47e780e6cbbddb79 100644 (file)
@@ -1,3 +1,7 @@
+2020-09-02  Alan Modra  <amodra@gmail.com>
+
+       * config/tc-nios2.c (md_apply_fix): Avoid too large shift.
+
 2020-09-02  Alan Modra  <amodra@gmail.com>
 
        * config/tc-mips.c (load_register): Avoid too large shift.
index 0134b15ae0801260f8ca5071369b7970bd0410b7..5f0033a9f0c1ceed6a2017ba9e54d34dfe63717c 100644 (file)
@@ -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;
              }
            }