diff options
author | Kevin Enderby <enderby@apple.com> | 2012-07-24 21:40:01 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2012-07-24 21:40:01 +0000 |
commit | 216ac319719179dff3fbac5fa70f3238675dc8cd (patch) | |
tree | a44b59e6f6e304025278ceaa5071c1a4358b7397 /llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp | |
parent | 38be931223fc6fbd1ab327a5827874f0c0694f85 (diff) | |
download | bcm5719-llvm-216ac319719179dff3fbac5fa70f3238675dc8cd.tar.gz bcm5719-llvm-216ac319719179dff3fbac5fa70f3238675dc8cd.zip |
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
llvm-svn: 160694
Diffstat (limited to 'llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp')
-rw-r--r-- | llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp b/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp index 4bbfe95eb43..e936b521073 100644 --- a/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp +++ b/llvm/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; |