Fix ubsan signed integer overflow
authorAlan Modra <amodra@gmail.com>
Thu, 23 Jul 2015 03:11:38 +0000 (12:41 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 23 Jul 2015 03:22:46 +0000 (12:52 +0930)
IMO a fairly useless warning in this case, but technically correct.

PR 18708
* i386-dis.c (get64): Avoid signed integer overflow.

opcodes/ChangeLog
opcodes/i386-dis.c

index 6ba1b856d9f898f0fef398392903cdba87031d6a..f1ec2b030fe60436358ceea2f346bb85b26d993f 100644 (file)
@@ -1,3 +1,8 @@
+2015-07-23  Alan Modra  <amodra@gmail.com>
+
+       PR 18708
+       * i386-dis.c (get64): Avoid signed integer overflow.
+
 2015-07-22  Alexander Fomin  <alexander.fomin@intel.com>
 
        PR binutils/18631
@@ -82,7 +87,7 @@
 
 2015-06-19  Peter Bergner  <bergner@vnet.ibm.com>
 
-        * ppc-dis.h (skip_optional_operands): Use ppc_optional_operand_value.
+       * ppc-dis.h (skip_optional_operands): Use ppc_optional_operand_value.
        * ppc-opc.c (FXM4): Add non-zero optional value.
        (TBR): Likewise.
        (SXL): Likewise.
index e76802920392a69e1619110dd92840a1be69cc31..a279b56d7f61bc85e34cba2a7da38aa4bfb81f73 100644 (file)
@@ -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 ();
This page took 0.02806 seconds and 4 git commands to generate.