[llvm] r225950 - X86: only access operands if they are present

Saleem Abdulrasool compnerd at compnerd.org
Tue Jan 13 21:37:11 PST 2015


Author: compnerd
Date: Tue Jan 13 23:37:10 2015
New Revision: 225950

URL: http://llvm.org/viewvc/llvm-project?rev=225950&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp

Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=225950&r1=225949&r2=225950&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Tue Jan 13 23:37:10 2015
@@ -2277,6 +2277,8 @@ bool X86AsmParser::validateInstruction(M
   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]");





More information about the llvm-commits mailing list