From: Saleem Abdulrasool Date: Wed, 14 Jan 2015 05:37:10 +0000 (+0000) Subject: X86: only access operands if they are present X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1f65e239a229aac51977a4f7c67317cab4d075a;p=llvm X86: only access operands if they are present If there is no associated immediate (MS style inline asm), do not try to access the operand, assume that it is valid. This should fix the buildbots after SVN r225941. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225950 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 28824488a71..02d48470615 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -2277,6 +2277,8 @@ bool X86AsmParser::validateInstruction(MCInst &Inst, const OperandVector &Ops) { switch (Inst.getOpcode()) { default: return true; case X86::INT: + if (Inst.getNumOperands() == 0) + return true; assert(Inst.getOperand(0).isImm() && "expected immediate"); if (Inst.getOperand(0).getImm() > 255) { Error(Ops[1]->getStartLoc(), "interrupt vector must be in range [0-255]");