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
This commit is contained in:
Saleem Abdulrasool 2015-01-14 05:37:10 +00:00
parent 497b958447
commit e1f65e239a

View File

@ -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]");