diff options
author | Kevin Enderby <enderby@apple.com> | 2012-03-09 17:52:49 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2012-03-09 17:52:49 +0000 |
commit | faf72ffda3bf83b08769428129ee4755787ee6cf (patch) | |
tree | 645b3e62f0af088abacb1e31e869e8610b8b701c /lib/Target/X86/Disassembler/X86DisassemblerDecoder.c | |
parent | 75c0d8e0d8f4e10587985b950f2c0752e45e099e (diff) |
Fix the x86 disassembler to at least print the lock prefix if it is the first
prefix. Added a FIXME to remind us this still does not work when it is not the
first prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/Disassembler/X86DisassemblerDecoder.c')
-rw-r--r-- | lib/Target/X86/Disassembler/X86DisassemblerDecoder.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c index b0e66f00c7..6f7e8f2346 100644 --- a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c +++ b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c @@ -312,6 +312,13 @@ static int readPrefixes(struct InternalInstruction* insn) { if (consumeByte(insn, &byte)) return -1; + + // If the the first byte is a LOCK prefix break and let it be disassembled + // as a lock "instruction", by creating an <MCInst #xxxx LOCK_PREFIX>. + // FIXME there is currently no way to get the disassembler to print the + // lock prefix if it is not the first byte. + if (insn->readerCursor - 1 == insn->startLocation && byte == 0xf0) + break; switch (byte) { case 0xf0: /* LOCK */ |