From 9c26bcca5a09c226ec0d702e8e644ad71188d298 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 2 Mar 2015 03:33:11 +0000 Subject: [PATCH] [X86] There are only 8 mask registers. Fail disassembly if instruction tries to reference more. llvm-svn: 230931 --- llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp index 619a0d4..49e6403 100644 --- a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp +++ b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp @@ -1458,6 +1458,8 @@ static int readModRM(struct InternalInstruction* insn) { case TYPE_VK1: \ case TYPE_VK8: \ case TYPE_VK16: \ + if (index > 7) \ + *valid = 0; \ return prefix##_K0 + index; \ case TYPE_MM64: \ return prefix##_MM0 + (index & 0x7); \ -- 2.7.4