ubsan: crx: left shift cannot be represented in type 'int'
authorAlan Modra <amodra@gmail.com>
Sun, 15 Dec 2019 23:28:09 +0000 (09:58 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 16 Dec 2019 07:03:53 +0000 (17:33 +1030)
commit36bd8ea7f06126d3e73d9644325c4bbfbd5c89f4
tree77e25b9b88b4f91e648c5098376aa17f4e9796c2
parentcedfc77485dbb566619dc1e2d729ce0a70d1a4ad
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.
include/ChangeLog
include/opcode/crx.h
opcodes/ChangeLog
opcodes/crx-dis.c