From a67ad149e188c4c65ad2424772246b40702bed98 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Thu, 18 Sep 2014 23:22:02 +0200 Subject: [PATCH] Fix mem corruption: iterator might be invalidated by insertion. --- interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp b/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp index 269368e..d87ea2f 100644 --- a/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp +++ b/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp @@ -119,13 +119,13 @@ namespace cling { } if (shouldSkip(D)) { skipCurrentDecl(true); - Insert.first->second = false; + m_Visited[getCanonicalOrNamespace(D)] = false; } else { clang::DeclVisitor::Visit(D); if (m_SkipFlag) { // D was not good, flag it. skipCurrentDecl(true); - Insert.first->second = false; + m_Visited[getCanonicalOrNamespace(D)] = false; } } } -- 1.8.2