Added additional check for invalid AVX-512 zero masks

This commit is contained in:
flobernd 2017-11-29 22:47:09 +01:00
parent 6d690a4893
commit beeaa0e279
No known key found for this signature in database
GPG Key ID: 9C3AE0ED4A969F10
1 changed files with 5 additions and 0 deletions

View File

@ -559,6 +559,11 @@ static ZydisStatus ZydisDecodeEVEX(ZydisDecoderContext* context,
instruction->raw.evex.aaa = (data[3] >> 0) & 0x07;
if (instruction->raw.evex.z && !instruction->raw.evex.aaa)
{
return ZYDIS_STATUS_INVALID_MASK; // TODO: Dedicated status code
}
// Update internal fields
context->cache.W = instruction->raw.evex.W;
context->cache.R = 0x01 & ~instruction->raw.evex.R;