From 3888916da84288994be10d6ae1a2db5b45b3f8f8 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 15 Apr 2015 11:28:16 -0700 Subject: [PATCH] Check dp->prefix_requirement instead This patch removes prefix_requirement and checks dp->prefix_requirement instead. * i386-dis.c (prefix_requirement): Removed. (print_insn): Don't set prefix_requirement. Check dp->prefix_requirement instead of prefix_requirement. --- opcodes/ChangeLog | 6 ++++++ opcodes/i386-dis.c | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index b46c861032..0742cccce1 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2015-04-15 H.J. Lu + + * i386-dis.c (prefix_requirement): Removed. + (print_insn): Don't set prefix_requirement. Check + dp->prefix_requirement instead of prefix_requirement. + 2015-04-15 H.J. Lu PR binutils/17898 diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 76ecb5a78b..ca9ea2deb4 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -3082,8 +3082,6 @@ static int last_addr_prefix; static int last_rex_prefix; static int last_seg_prefix; static int fwait_prefix; -/* The PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is mandatory. */ -static int prefix_requirement; /* The active segment register prefix. */ static int active_seg_prefix; #define MAX_CODE_LENGTH 15 @@ -13053,14 +13051,12 @@ print_insn (bfd_vma pc, disassemble_info *info) threebyte = *++codep; dp = &dis386_twobyte[threebyte]; need_modrm = twobyte_has_modrm[*codep]; - prefix_requirement = dp->prefix_requirement; codep++; } else { dp = &dis386[*codep]; need_modrm = onebyte_has_modrm[*codep]; - prefix_requirement = 0; codep++; } @@ -13160,7 +13156,7 @@ print_insn (bfd_vma pc, disassemble_info *info) used by putop and MMX/SSE operand and may be overriden by the PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix separately. */ - if (prefix_requirement == PREFIX_OPCODE + if (dp->prefix_requirement == PREFIX_OPCODE && dp != &bad_opcode && (((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) != 0 -- 2.34.1