Add a test for .seh_pushframe parsing. Fix the bug exposed by it (and another
[oota-llvm.git] / lib / MC / MCParser / COFFAsmParser.cpp
index fa7ae5cf148a829369602de0076d0d7b601dddb6..540df377bbd2e5df33deda0fd694b9db95bc18c3 100644 (file)
@@ -343,13 +343,16 @@ bool COFFAsmParser::ParseSEHDirectiveSaveXMM(StringRef, SMLoc L) {
 }
 
 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))