Add a test for .seh_pushframe parsing. Fix the bug exposed by it (and another
one I found by inspection).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132037 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCParser/COFFAsmParser.cpp b/lib/MC/MCParser/COFFAsmParser.cpp
index fa7ae5c..540df37 100644
--- a/lib/MC/MCParser/COFFAsmParser.cpp
+++ b/lib/MC/MCParser/COFFAsmParser.cpp
@@ -343,13 +343,16 @@
}
bool COFFAsmParser::ParseSEHDirectivePushFrame(StringRef, SMLoc) {
- bool Code;
+ bool Code = false;
StringRef CodeID;
- SMLoc startLoc = getLexer().getLoc();
- if (!getParser().ParseIdentifier(CodeID)) {
- if (CodeID != "@code")
- return Error(startLoc, "expected @code");
- Code = true;
+ if (getLexer().is(AsmToken::At)) {
+ SMLoc startLoc = getLexer().getLoc();
+ Lex();
+ if (!getParser().ParseIdentifier(CodeID)) {
+ if (CodeID != "code")
+ return Error(startLoc, "expected @code");
+ Code = true;
+ }
}
if (getLexer().isNot(AsmToken::EndOfStatement))