aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2012-07-24 21:40:01 +0000
committerKevin Enderby <enderby@apple.com>2012-07-24 21:40:01 +0000
commit16b7dd64e91f1b05b40ebfeb64b49f3ac17cb426 (patch)
tree21487781d5429313a31789d530d6b3f8878e4bac /lib
parent952f5d562c40bc19147df4fbf3415069659236d1 (diff)
downloadexternal_llvm-16b7dd64e91f1b05b40ebfeb64b49f3ac17cb426.zip
external_llvm-16b7dd64e91f1b05b40ebfeb64b49f3ac17cb426.tar.gz
external_llvm-16b7dd64e91f1b05b40ebfeb64b49f3ac17cb426.tar.bz2
Fix a bug in the x86 disassembler's symbolic disassembly support for Jcc-Jump
if Condition Is Met instuctions that was not correctly determining the target instruction. So for a jne rel32 instruction: % cat x.s .byte 0x0f, 0x85, 0x09, 0x00, 0x00, 0x00 % as x.s it was incorrectly deterining the target: % otool -q -tv a.out a.out: (__TEXT,__text) section 0000000000000000 jne 0xd and with the fix it gets this correct as: % otool -q -tv a.out a.out: (__TEXT,__text) section 0000000000000000 jne 0xf rdar://11505997 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/Disassembler/X86Disassembler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/X86/Disassembler/X86Disassembler.cpp b/lib/Target/X86/Disassembler/X86Disassembler.cpp
index 4bbfe95..e936b52 100644
--- a/lib/Target/X86/Disassembler/X86Disassembler.cpp
+++ b/lib/Target/X86/Disassembler/X86Disassembler.cpp
@@ -327,7 +327,7 @@ static void translateImmediate(MCInst &mcInst, uint64_t immediate,
if (type == TYPE_RELv) {
isBranch = true;
pcrel = insn.startLocation +
- insn.displacementOffset + insn.displacementSize;
+ insn.immediateOffset + insn.immediateSize;
switch (insn.displacementSize) {
default:
break;