mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-25 11:04:18 +08:00
Re: ubsan: ns32k: left shift cannot be represented in type
* ns32k-dis.c (sign_extend): Correct last patch.
This commit is contained in:
parent
5c05618a0a
commit
5afa80e9a8
@ -1,3 +1,7 @@
|
||||
2019-12-11 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* ns32k-dis.c (sign_extend): Correct last patch.
|
||||
|
||||
2019-12-11 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* vax-dis.c (NEXTLONG): Avoid signed overflow.
|
||||
|
@ -327,8 +327,8 @@ bit_copy (bfd_byte *buffer, int offset, int count, char *to)
|
||||
static int
|
||||
sign_extend (unsigned int value, unsigned int bits)
|
||||
{
|
||||
unsigned int sign = 1u << bits;
|
||||
return ((value & (sign - 1)) ^ sign) - sign;
|
||||
unsigned int sign = 1u << (bits - 1);
|
||||
return ((value & (sign + sign - 1)) ^ sign) - sign;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user