From d93bba9e0d6c7bd3a570688612a3dd0a5eb0193a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 10 Dec 2019 23:37:03 +1030 Subject: ubsan: csky: left shift cannot be represented in type 'int' In the following buf is an unsigned char array, so elements are promoted to int before arithmetic operations. if (dis_info.info->endian == BFD_ENDIAN_BIG) while (n--) val |= buf[n] << (n*8); else for (i = 0; i < n; i++) val |= buf[i] << (i*8); * csky-dis.c (csky_chars_to_number): Rewrite. Avoid signed overflow when collecting bytes of a number. --- opcodes/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'opcodes/ChangeLog') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 6b76f15..5cd7361 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,10 @@ 2019-12-11 Alan Modra + * csky-dis.c (csky_chars_to_number): Rewrite. Avoid signed + overflow when collecting bytes of a number. + +2019-12-11 Alan Modra + * cris-dis.c (print_with_operands): Avoid signed integer overflow when collecting bytes of a 32-bit integer. -- cgit v1.1