diff options
author | Jan Stancek <jstancek@redhat.com> | 2015-08-24 14:50:15 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2015-08-24 14:50:15 +0100 |
commit | 5f40e14d768b94f7fdc050aeba5ee62e6a8d5756 (patch) | |
tree | 051d379f0a185b1a5553760607bbcb97767ec749 /opcodes/i386-dis.c | |
parent | 77c365df78441f7b968ec0f62c7ed9f5de36dc60 (diff) | |
download | gdb-5f40e14d768b94f7fdc050aeba5ee62e6a8d5756.zip gdb-5f40e14d768b94f7fdc050aeba5ee62e6a8d5756.tar.gz gdb-5f40e14d768b94f7fdc050aeba5ee62e6a8d5756.tar.bz2 |
Fix the partial disassembly of a broken three byte instruction at the end of a function.
opcodes * i386-dis.c (print_insn): Fix decoding of three byte operands.
tests * gas/i386/intel.s: Add test of disassembly of a potential
three byte instuction at the end of a function.
* gas/i386/intel.d: Update expected disassembly.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r-- | opcodes/i386-dis.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 055b38f..ae18cf2 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -13438,8 +13438,10 @@ print_insn (bfd_vma pc, disassemble_info *info) if (*codep == 0x0f) { unsigned char threebyte; - FETCH_DATA (info, codep + 2); - threebyte = *++codep; + + codep++; + FETCH_DATA (info, codep + 1); + threebyte = *codep; dp = &dis386_twobyte[threebyte]; need_modrm = twobyte_has_modrm[*codep]; codep++; |