]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add parentheses to prevent truncated addresses
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 15 Feb 2016 23:58:42 +0000 (15:58 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 16 Feb 2016 00:04:54 +0000 (16:04 -0800)
Backport from master

* i386-dis.c (print_insn): Parenthesize expression to prevent
truncated addresses.
(OP_J): Likewise.

opcodes/ChangeLog
opcodes/i386-dis.c

index e485a36c35f46477144fb296d6d3bdbd4af22617..7e20a8fae182ed3a911d782a179bb41b39cd9a8c 100644 (file)
@@ -1,3 +1,12 @@
+2016-02-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from master
+       2016-02-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * i386-dis.c (print_insn): Parenthesize expression to prevent
+       truncated addresses.
+       (OP_J): Likewise.
+
 2016-01-25  Tristan Gingold  <gingold@adacore.com>
 
        * configure: Regenerate.
index 1b4c51a55e6a3a5a4134dbdc096d96b94ee328dc..3712b59805c020d934e38a914d406d7b19c560a2 100644 (file)
@@ -13644,7 +13644,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
     if (op_index[i] != -1 && op_riprel[i])
       {
        (*info->fprintf_func) (info->stream, "        # ");
-       (*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep
+       (*info->print_address_func) ((bfd_vma) (start_pc + (codep - start_codep)
                                                + op_address[op_index[i]]), info);
        break;
       }
@@ -16158,7 +16158,7 @@ OP_J (int bytemode, int sizeflag)
             the displacement is added!  */
          mask = 0xffff;
          if ((prefixes & PREFIX_DATA) == 0)
-           segment = ((start_pc + codep - start_codep)
+           segment = ((start_pc + (codep - start_codep))
                       & ~((bfd_vma) 0xffff));
        }
       if (address_mode != mode_64bit