diff options
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index e74952a4ca..f4de09a1c0 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -279,6 +279,13 @@ AsmParser::AsmParser(const Target &T, SourceMgr &_SM, MCContext &_Ctx, } AsmParser::~AsmParser() { + assert(ActiveMacros.empty() && "Unexpected active macro instantiation!"); + + // Destroy any macros. + for (StringMap<Macro*>::iterator it = MacroMap.begin(), + ie = MacroMap.end(); it != ie; ++it) + delete it->getValue(); + delete PlatformParser; delete GenericParser; } |