From: Argyrios Kyrtzidis Date: Sat, 23 Aug 2008 12:12:06 +0000 (+0000) Subject: Add a safety check. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2174a4ff834b72c0a0e3f24e4b62123f30f4cce6;p=clang Add a safety check. Make sure there's no "dangling" backtrack position when Preprocessor is destroyed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55236 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index a4ff8bb734..18b106ad84 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -84,6 +84,8 @@ Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts, } Preprocessor::~Preprocessor() { + assert(BacktrackPositions.empty() && "EnableBacktrack/Backtrack imbalance!"); + // Free any active lexers. delete CurLexer;