[PATCH] D29410: [Assembler] Restore diagnostics handler after parsing.
Sanne Wouda via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 1 11:37:50 PST 2017
sanwou01 created this revision.
The AsmParser's diagnostics handler is no longer valid once the
AsmParser gets destructed. Restore the saved handlers back into the
SourceMgr.
https://reviews.llvm.org/D29410
Files:
lib/MC/MCParser/AsmParser.cpp
Index: lib/MC/MCParser/AsmParser.cpp
===================================================================
--- lib/MC/MCParser/AsmParser.cpp
+++ lib/MC/MCParser/AsmParser.cpp
@@ -608,6 +608,10 @@
AsmParser::~AsmParser() {
assert((HadError || ActiveMacros.empty()) &&
"Unexpected active macro instantiation!");
+
+ // Restore the saved diagnostics handler and context for use during
+ // finalization.
+ SrcMgr.setDiagHandler(SavedDiagHandler, SavedDiagContext);
}
void AsmParser::printMacroInstantiations() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29410.86688.patch
Type: text/x-patch
Size: 528 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170201/d98132c8/attachment.bin>
More information about the llvm-commits
mailing list