Skip if size of bfd_vma is smaller than address size
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 23 Apr 2016 16:32:59 +0000 (09:32 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 23 Apr 2016 16:32:59 +0000 (09:32 -0700)
Disassembler won't work properly when size of bfd_vma is smaller than
address size.

PR binutils/19983
PR binutils/19984
* i386-dis.c (print_insn): Return -1 if size of bfd_vma is
smaller than address size.

opcodes/ChangeLog
opcodes/i386-dis.c

index c42397614cff1cb9cc7f17c7c1a0b1b7734c70b7..b83508607d0436ba0c36793c7362d7aa3d80ea35 100644 (file)
@@ -1,3 +1,10 @@
+2016-04-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/19983
+       PR binutils/19984
+       * i386-dis.c (print_insn): Return -1 if size of bfd_vma is
+       smaller than address size.
+
 2016-04-20  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
 
        * alpha-dis.c: Regenerate.
index de0534c24e7dea107281d61e4eea4007181a44a7..560f75cc024fc43b88e26d457883e49e0a565a7f 100644 (file)
@@ -13327,6 +13327,13 @@ print_insn (bfd_vma pc, disassemble_info *info)
        p++;
     }
 
+  if (address_mode == mode_64bit && sizeof (bfd_vma) < 8)
+    {
+      (*info->fprintf_func) (info->stream,
+                            _("64-bit address is disabled"));
+      return -1;
+    }
+
   if (intel_syntax)
     {
       names64 = intel_names64;