aboutsummaryrefslogtreecommitdiff
path: root/i386-asm.h
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-05-16 05:10:21 +0200
committerMichael Matz <matz@suse.de>2016-05-16 05:10:21 +0200
commitf2a4cb0a0edc95ae74816275e82b4ade71c6f37a (patch)
treeeaae6cc045f5d4271dd9778cbdb0b222b2c1470e /i386-asm.h
parent0f36f60faa05da7e250a4b4eebd4b534e8a2b537 (diff)
downloadtinycc-f2a4cb0a0edc95ae74816275e82b4ade71c6f37a.tar.gz
tinycc-f2a4cb0a0edc95ae74816275e82b4ade71c6f37a.tar.bz2
x86-asm: Reject some invalid arith imm8 instruction
There were two errors in the arithmetic imm8 instruction. They accept only REGW, and in case the user write a xxxb opcode that variant needs to be rejected as well (it's not automatically rejected by REGW in case the destination is memory).
Diffstat (limited to 'i386-asm.h')
-rw-r--r--i386-asm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/i386-asm.h b/i386-asm.h
index ae7d899..5b81c11 100644
--- a/i386-asm.h
+++ b/i386-asm.h
@@ -157,7 +157,7 @@ ALT(DEF_ASM_OP2(lgs, 0x0fb5, 0, OPC_MODRM, OPT_EA, OPT_REG32))
ALT(DEF_ASM_OP2(addb, 0x00, 0, OPC_ARITH | OPC_MODRM | OPC_BWLX, OPT_REG, OPT_EA | OPT_REG)) /* XXX: use D bit ? */
ALT(DEF_ASM_OP2(addb, 0x02, 0, OPC_ARITH | OPC_MODRM | OPC_BWLX, OPT_EA | OPT_REG, OPT_REG))
ALT(DEF_ASM_OP2(addb, 0x04, 0, OPC_ARITH | OPC_BWLX, OPT_IM, OPT_EAX))
-ALT(DEF_ASM_OP2(addw, 0x83, 0, OPC_ARITH | OPC_MODRM | OPC_WLX, OPT_IM8S, OPT_EA | OPT_REG))
+ALT(DEF_ASM_OP2(addw, 0x83, 0, OPC_ARITH | OPC_MODRM | OPC_WLX, OPT_IM8S, OPT_EA | OPT_REGW))
ALT(DEF_ASM_OP2(addb, 0x80, 0, OPC_ARITH | OPC_MODRM | OPC_BWLX, OPT_IM, OPT_EA | OPT_REG))
ALT(DEF_ASM_OP2(testb, 0x84, 0, OPC_MODRM | OPC_BWLX, OPT_REG, OPT_EA | OPT_REG))