mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-29 04:53:56 +08:00
ubsan: s12z: left shift cannot be represented in type 'int'
* s12z-opc.c (z_decode_signed_value): Avoid signed overflow.
This commit is contained in:
parent
fb4cb4e26d
commit
205c426a9b
@ -1,3 +1,7 @@
|
||||
2019-12-11 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* s12z-opc.c (z_decode_signed_value): Avoid signed overflow.
|
||||
|
||||
2019-12-11 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* ns32k-dis.c (bit_extract): Use unsigned arithmetic.
|
||||
|
@ -410,9 +410,7 @@ z_decode_signed_value (struct mem_read_abstraction_base *mra, int offset,
|
||||
int i;
|
||||
uint32_t value = 0;
|
||||
for (i = 0; i < size; ++i)
|
||||
{
|
||||
value |= buffer[i] << (8 * (size - i - 1));
|
||||
}
|
||||
value = (value << 8) | buffer[i];
|
||||
|
||||
if (buffer[0] & 0x80)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user