From 36bd8ea7f06126d3e73d9644325c4bbfbd5c89f4 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 16 Dec 2019 09:58:09 +1030 Subject: 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 ): 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. --- include/opcode/crx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/opcode') 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. */ -- cgit v1.1