]> granicus.if.org Git - clang/commitdiff
Add a safety check.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 23 Aug 2008 12:12:06 +0000 (12:12 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 23 Aug 2008 12:12:06 +0000 (12:12 +0000)
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

lib/Lex/Preprocessor.cpp

index a4ff8bb73482dbb42b03098f1b7f1da07fcbb980..18b106ad84127fe13ed597dddfbe486d8e35a58e 100644 (file)
@@ -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;