MC: loosen an overzealous assertion

Permit active macro expansions when terminating the assembler if there were
errors during the expansion.  This would only trigger on invalid input when
built with assertions.

llvm-svn: 209309
This commit is contained in:
Saleem Abdulrasool 2014-05-21 17:53:18 +00:00
parent 962a339bec
commit 6eae1e6bbf
2 changed files with 12 additions and 1 deletions

View File

@ -528,7 +528,8 @@ AsmParser::AsmParser(SourceMgr &_SM, MCContext &_Ctx, MCStreamer &_Out,
}
AsmParser::~AsmParser() {
assert(ActiveMacros.empty() && "Unexpected active macro instantiation!");
assert((HadError || ActiveMacros.empty()) &&
"Unexpected active macro instantiation!");
// Destroy any macros.
for (StringMap<MCAsmMacro *>::iterator it = MacroMap.begin(),

View File

@ -0,0 +1,10 @@
// RUN: not llvm-mc -triple i686-linux -o /dev/null %s
// REQUIRES: asserts
.macro macro parameter=0
.if \parameter
.else
.endm
macro 1