summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Gramner <henrik@gramner.com>2017-04-20 16:02:19 +0200
committerH. Peter Anvin <hpa@linux.intel.com>2017-04-20 17:48:44 -0700
commit16d4db3aab498a89d71b57752fbed3d1b5c039cc (patch)
treef0d2ae88897908747cc12f38a606e7935c11bc3e
parent32b9824f5c8539f1ca53b36725575a2d96d58ca2 (diff)
downloadnasm-16d4db3aab498a89d71b57752fbed3d1b5c039cc.tar.gz
Fix ModR/M.mod for EVEX instructions
It was incorrectly set to 01b in some cases when where it should be 10b. Fixes BR 3392402. Signed-off-by: Henrik Gramner <henrik@gramner.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--asm/assemble.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/asm/assemble.c b/asm/assemble.c
index 9c76b0ea..31db516a 100644
--- a/asm/assemble.c
+++ b/asm/assemble.c
@@ -2426,13 +2426,11 @@ static enum match_result matches(const struct itemplate *itemp,
* - offset can fit in a byte when EVEX is not used
* - offset can be compressed when EVEX is used
*/
-#define IS_MOD_01() (input->eaflags & EAF_BYTEOFFS || \
- (o >= -128 && o <= 127 && \
- seg == NO_SEG && !forw_ref && \
- !(input->eaflags & EAF_WORDOFFS) && \
- !(ins->rex & REX_EV)) || \
- (ins->rex & REX_EV && \
- is_disp8n(input, ins, &output->disp8)))
+#define IS_MOD_01() (!(input->eaflags & EAF_WORDOFFS) && \
+ (ins->rex & REX_EV ? seg == NO_SEG && !forw_ref && \
+ is_disp8n(input, ins, &output->disp8) : \
+ input->eaflags & EAF_BYTEOFFS || (o >= -128 && \
+ o <= 127 && seg == NO_SEG && !forw_ref)))
static enum ea_type process_ea(operand *input, ea *output, int bits,
int rfield, opflags_t rflags, insn *ins,