summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorArtyom Skrobov <Artyom.Skrobov@arm.com>2014-05-29 11:26:15 +0000
committerArtyom Skrobov <Artyom.Skrobov@arm.com>2014-05-29 11:26:15 +0000
commit7e9e31ebaf9d63d921e4e3f3c48a1536c145eebb (patch)
tree66814ec5e9ed7d42f92857a2c6e5e240907a4690 /llvm/lib
parent8745993ec42da38519f4042dd6ac8b387575e788 (diff)
downloadbcm5719-llvm-7e9e31ebaf9d63d921e4e3f3c48a1536c145eebb.tar.gz
bcm5719-llvm-7e9e31ebaf9d63d921e4e3f3c48a1536c145eebb.zip
Add missing check when MatchInstructionImpl() reports failure
llvm-svn: 209802
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
index 65b77c547dc..33371189644 100644
--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -3794,6 +3794,8 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
case Match_InvalidLabel:
case Match_MSR:
case Match_MRS: {
+ if (ErrorInfo >= Operands.size())
+ return Error(IDLoc, "too few operands for instruction");
// Any time we get here, there's nothing fancy to do. Just get the
// operand SMLoc and display the diagnostic.
SMLoc ErrorLoc = ((AArch64Operand *)Operands[ErrorInfo])->getStartLoc();
OpenPOWER on IntegriCloud