aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCParser
diff options
context:
space:
mode:
authorCharles Davis <cdavis@mines.edu>2011-05-25 04:08:15 +0000
committerCharles Davis <cdavis@mines.edu>2011-05-25 04:08:15 +0000
commit47268164f3d660f6357cc3a59d510efe3bc9152f (patch)
treea1b204797ec05f77070d9f27dd930721406c71c7 /lib/MC/MCParser
parentfc2bb8c4448fa884d79e437cc2d2627a7d7740a8 (diff)
downloadexternal_llvm-47268164f3d660f6357cc3a59d510efe3bc9152f.zip
external_llvm-47268164f3d660f6357cc3a59d510efe3bc9152f.tar.gz
external_llvm-47268164f3d660f6357cc3a59d510efe3bc9152f.tar.bz2
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
Diffstat (limited to 'lib/MC/MCParser')
-rw-r--r--lib/MC/MCParser/COFFAsmParser.cpp15
1 files changed, 9 insertions, 6 deletions
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::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))