diff options
author | Alan Modra <amodra@gmail.com> | 2019-12-10 23:02:37 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-12-11 11:38:04 +1030 |
commit | 0ef562a4b5da6bc1f16b2ea801b228acafd033d8 (patch) | |
tree | 4d87c16e9066d5947b56c349141008c063a76b6f /opcodes/ChangeLog | |
parent | 2fd2b153a3819d3ab6b9c4cf06943d498187714c (diff) | |
download | gdb-0ef562a4b5da6bc1f16b2ea801b228acafd033d8.zip gdb-0ef562a4b5da6bc1f16b2ea801b228acafd033d8.tar.gz gdb-0ef562a4b5da6bc1f16b2ea801b228acafd033d8.tar.bz2 |
ubsan: cr16: left shift cannot be represented in type 'int'
This was:
unsigned long mask = SBM (instruction->match_bits);
with
#define SBM(offs) ((((1 << (32 - offs)) -1) << (offs)))
Well, there are a couple of problems. Firstly, the expression uses
int values (1 rather than 1u or 1ul) resulting in the ubsan error, and
secondly, a zero offs will result in a 32-bit shift which is undefined
if ints are only 32 bits.
* cr16-dis.c (EXTRACT, SBM): Rewrite.
(cr16_match_opcode): Delete duplicate bcond test.
Diffstat (limited to 'opcodes/ChangeLog')
-rw-r--r-- | opcodes/ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index faa160a..57212f8 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,10 @@ 2019-12-11 Alan Modra <amodra@gmail.com> + * cr16-dis.c (EXTRACT, SBM): Rewrite. + (cr16_match_opcode): Delete duplicate bcond test. + +2019-12-11 Alan Modra <amodra@gmail.com> + * bfin-dis.c (HOST_LONG_WORD_SIZE, XFIELD): Delete. (SIGNBIT): New. (MASKBITS, SIGNEXTEND): Rewrite. |