aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-01-14 05:37:10 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-01-14 05:37:10 +0000
commitaa32297fb85ddd9719e7729a3e76311536ffaf75 (patch)
tree190d2345b77bdcb5ef5639b6115d5b37e0a5ba1f /llvm/lib
parent8923cc5470a1a6c728c800a409d1c6c86d52825a (diff)
downloadllvm-aa32297fb85ddd9719e7729a3e76311536ffaf75.zip
llvm-aa32297fb85ddd9719e7729a3e76311536ffaf75.tar.gz
llvm-aa32297fb85ddd9719e7729a3e76311536ffaf75.tar.bz2
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. llvm-svn: 225950
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 2882448..02d4847 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/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]");