Fixed a bug in the X86 disassembler where a member of the
authorSean Callanan <scallanan@apple.com>
Mon, 21 Feb 2011 21:55:05 +0000 (21:55 +0000)
committerSean Callanan <scallanan@apple.com>
Mon, 21 Feb 2011 21:55:05 +0000 (21:55 +0000)
X86 instruction decode structure was being interpreted as
being in units of bits, although it is actually stored in
units of bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126147 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/Disassembler/X86Disassembler.cpp
lib/Target/X86/Disassembler/X86DisassemblerDecoder.h

index 691e2d7204ab97f1aee17692acc1704122e9503d..f7777561b6a745aaf952d903a32091034b309029 100644 (file)
@@ -168,16 +168,16 @@ static void translateImmediate(MCInst &mcInst, uint64_t immediate,
     switch (insn.displacementSize) {
     default:
       break;
-    case 8:
+    case 1:
       type = TYPE_MOFFS8;
       break;
-    case 16:
+    case 2:
       type = TYPE_MOFFS16;
       break;
-    case 32:
+    case 4:
       type = TYPE_MOFFS32;
       break;
-    case 64:
+    case 8:
       type = TYPE_MOFFS64;
       break;
     }
index 4f4fbcdd394cfd02f28407f36689fe08c1a3e014..d0dc8b56aea501bc631ea0ffeb26bb32fd956e07 100644 (file)
@@ -399,7 +399,7 @@ struct InternalInstruction {
   /* The segment override type */
   SegmentOverride segmentOverride;
   
-  /* Sizes of various critical pieces of data */
+  /* Sizes of various critical pieces of data, in bytes */
   uint8_t registerSize;
   uint8_t addressSize;
   uint8_t displacementSize;