diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-27 13:46:45 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-27 21:56:33 +0930 |
commit | 6fbd4a8e8baa7fe5adcaa1c11c885f741fccd250 (patch) | |
tree | 4b80225e1bf7e27a71628b88ef5db6976659c3fe /gas/cgen.c | |
parent | cd570d497efca7b71ca999cb80d24bfcea5181ac (diff) | |
download | gdb-6fbd4a8e8baa7fe5adcaa1c11c885f741fccd250.zip gdb-6fbd4a8e8baa7fe5adcaa1c11c885f741fccd250.tar.gz gdb-6fbd4a8e8baa7fe5adcaa1c11c885f741fccd250.tar.bz2 |
PR26467 UBSAN: cgen.c:762 shift exponent 18446744073709551615
PR 26467
* cgen.c (weak_operand_overflow_check): Handle opmask for
operand length zero. Use 1UL constant.
Diffstat (limited to 'gas/cgen.c')
-rw-r--r-- | gas/cgen.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -759,7 +759,7 @@ weak_operand_overflow_check (const expressionS * exp, { const unsigned long len = operand->length; unsigned long mask; - unsigned long opmask = (((1L << (len - 1)) - 1) << 1) | 1; + unsigned long opmask = len == 0 ? 0 : (1UL << (len - 1) << 1) - 1; if (!exp) return NULL; |