diff options
author | Alan Modra <amodra@gmail.com> | 2019-12-10 23:37:03 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-12-11 11:38:45 +1030 |
commit | d93bba9e0d6c7bd3a570688612a3dd0a5eb0193a (patch) | |
tree | ec55590cd16f5df7b8ca806f773181ace2294e50 /opcodes/ChangeLog | |
parent | c202f69e5130fed314afa079ce30abaad4d34991 (diff) | |
download | gdb-d93bba9e0d6c7bd3a570688612a3dd0a5eb0193a.zip gdb-d93bba9e0d6c7bd3a570688612a3dd0a5eb0193a.tar.gz gdb-d93bba9e0d6c7bd3a570688612a3dd0a5eb0193a.tar.bz2 |
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.
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 6b76f15..5cd7361 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,10 @@ 2019-12-11 Alan Modra <amodra@gmail.com> + * csky-dis.c (csky_chars_to_number): Rewrite. Avoid signed + overflow when collecting bytes of a number. + +2019-12-11 Alan Modra <amodra@gmail.com> + * cris-dis.c (print_with_operands): Avoid signed integer overflow when collecting bytes of a 32-bit integer. |