When parsing a sequence of tokens beginning with {, it will hit an assert and crash if the token afterwards is not an identifier. Instead of this, return a more verbose error as seen elsewhere in the function.
Patch by Brandon Jones (BrandonTJones)
Differential Revision: https://reviews.llvm.org/D57375
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354356
91177308-0d34-0410-b5e6-
96231b3b80d8
const AsmToken &Tok = Parser.getTok();
// Eat "{" and mark the current place.
const SMLoc consumedToken = consumeToken();
+ if (Tok.isNot(AsmToken::Identifier))
+ return ErrorOperand(Tok.getLoc(), "Expected an identifier after {");
if (Tok.getIdentifier().startswith("r")){
int rndMode = StringSwitch<int>(Tok.getIdentifier())
.Case("rn", X86::STATIC_ROUNDING::TO_NEAREST_INT)
// ERR: invalid operand for instruction
cvtsd2sil {rn-sae}, %xmm1, %eax
+
+// ERR: Expected an identifier after {
+cvtsd2sil {{sae}, %xmm1, %eax