summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2014-02-17 21:45:27 +0000
committerKevin Enderby <enderby@apple.com>2014-02-17 21:45:27 +0000
commit6287371ce629196749925d73cd143cb2dd35b8e7 (patch)
treec1e3dda10ab83da8d2909bc384d6c1706910f76a /llvm/lib/Target
parent848095748605464e4d63d6c49976adc7483e6ff9 (diff)
downloadbcm5719-llvm-6287371ce629196749925d73cd143cb2dd35b8e7.tar.gz
bcm5719-llvm-6287371ce629196749925d73cd143cb2dd35b8e7.zip
Fix the arm assembler so that this malformed instruction:
ldrd r6, r7 [r2, #15] simply gives an error and does not triggers an assertion. As Jim points out, the diagnostic is really strange here, but fixing that would be more complicated. The missing comma results in the parser expecting a construct like r2[2], which is the vector index thing the error message is talking about. That's not what the user intended, though, and there's nothing else in the instruction that looks at all like a vector. Yet more fallout from not having a real parser here and trying to do context-free generic matching for addressing modes. rdar://15097243 llvm-svn: 201531
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index e2df2ab16c0..1d300a66c5d 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -2778,7 +2778,8 @@ int ARMAsmParser::tryParseShiftRegister(
SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
SMLoc S = Parser.getTok().getLoc();
const AsmToken &Tok = Parser.getTok();
- assert(Tok.is(AsmToken::Identifier) && "Token is not an Identifier");
+ if (Tok.isNot(AsmToken::Identifier))
+ return -1;
std::string lowerCase = Tok.getString().lower();
ARM_AM::ShiftOpc ShiftTy = StringSwitch<ARM_AM::ShiftOpc>(lowerCase)
OpenPOWER on IntegriCloud