decode: Fix combinations of VEX with legacy prefix

This commit is contained in:
Alexis Engelke
2020-11-21 14:59:25 +01:00
parent 318fdc50eb
commit 7f0bd4de8b
2 changed files with 10 additions and 2 deletions

View File

@@ -128,10 +128,10 @@ decode_prefixes(const uint8_t* buffer, int len, DecodeMode mode,
goto out;
// VEX + 66/F2/F3/LOCK will #UD.
if (prefixes & (PREFIX_REP|PREFIX_REPNZ|PREFIX_OPSZ|PREFIX_LOCK))
if (prefixes & (PREFIX_OPSZ|PREFIX_LOCK))
return FD_ERR_UD;
// VEX + REX will #UD.
if (rex_prefix)
if (rex_prefix || rep)
return FD_ERR_UD;
prefixes |= PREFIX_VEX;