diff options
author | Alan Modra <amodra@gmail.com> | 2015-07-23 12:41:38 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2015-07-23 12:52:46 +0930 |
commit | 070fe95d07c78349f0c8f0fa90aeb92d05248483 (patch) | |
tree | 5bdbfbf2de64a4185f7608754c73254ef2d96120 /opcodes/i386-dis.c | |
parent | 510fac86d7a8855fc680466f07ae266802c5fb40 (diff) | |
download | gdb-070fe95d07c78349f0c8f0fa90aeb92d05248483.zip gdb-070fe95d07c78349f0c8f0fa90aeb92d05248483.tar.gz gdb-070fe95d07c78349f0c8f0fa90aeb92d05248483.tar.bz2 |
Fix ubsan signed integer overflow
IMO a fairly useless warning in this case, but technically correct.
PR 18708
* i386-dis.c (get64): Avoid signed integer overflow.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r-- | opcodes/i386-dis.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index e768029..a279b56 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -15387,11 +15387,11 @@ get64 (void) a = *codep++ & 0xff; a |= (*codep++ & 0xff) << 8; a |= (*codep++ & 0xff) << 16; - a |= (*codep++ & 0xff) << 24; + a |= (*codep++ & 0xffu) << 24; b = *codep++ & 0xff; b |= (*codep++ & 0xff) << 8; b |= (*codep++ & 0xff) << 16; - b |= (*codep++ & 0xff) << 24; + b |= (*codep++ & 0xffu) << 24; x = a + ((bfd_vma) b << 32); #else abort (); |