aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-12-16 09:58:09 +1030
committerAlan Modra <amodra@gmail.com>2019-12-16 17:33:53 +1030
commit36bd8ea7f06126d3e73d9644325c4bbfbd5c89f4 (patch)
tree77e25b9b88b4f91e648c5098376aa17f4e9796c2 /include
parentcedfc77485dbb566619dc1e2d729ce0a70d1a4ad (diff)
downloadfsf-binutils-gdb-36bd8ea7f06126d3e73d9644325c4bbfbd5c89f4.zip
fsf-binutils-gdb-36bd8ea7f06126d3e73d9644325c4bbfbd5c89f4.tar.gz
fsf-binutils-gdb-36bd8ea7f06126d3e73d9644325c4bbfbd5c89f4.tar.bz2
ubsan: crx: left shift cannot be represented in type 'int'
The ubsan complaint is fixed by the SBM change, with similar possible complaints fixed by the EXTRACT change. The rest is just cleanup. include/ * opcode/crx.h (inst <match>): Make unsigned int. opcodes/ * crx-dis.c (EXTRACT, SBM): Avoid signed overflow. (get_number_of_operands, getargtype, getbits, getregname), (getcopregname, getprocregname, gettrapstring, getcinvstring), (getregliststring, get_word_at_PC, get_words_at_PC, build_mask), (powerof2, match_opcode, make_instruction, print_arguments), (print_arg): Delete forward declarations, moving static to.. (getregname, getcopregname, getregliststring): ..these definitions. (build_mask): Return unsigned int mask. (match_opcode): Use unsigned int vars.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/opcode/crx.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 7f6cc9b..a9be17a 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,9 @@
2019-12-16 Alan Modra <amodra@gmail.com>
+ * opcode/crx.h (inst <match>): Make unsigned int.
+
+2019-12-16 Alan Modra <amodra@gmail.com>
+
* opcode/nds32.h (N32_BIT): Define using 1u.
(__SEXT): Use __MASK and N32_BIT.
(N32_IMMS): Remove duplicate mask.
diff --git a/include/opcode/crx.h b/include/opcode/crx.h
index cac0767..81a8c9b 100644
--- a/include/opcode/crx.h
+++ b/include/opcode/crx.h
@@ -260,7 +260,7 @@ typedef struct
/* Size (in words). */
unsigned int size;
/* Constant prefix (matched by the disassembler). */
- unsigned long match;
+ unsigned int match;
/* Match size (in bits). */
int match_bits;
/* Attributes. */