From 778c416dc0dfe1dc74eeec4ebd83c764e9fc852b Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Mon, 29 Oct 2018 11:37:30 +0100 Subject: [PATCH] DynScopes: escape up to Stmt level (ROOT-9738). --- lib/Interpreter/DynamicLookup.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/Interpreter/DynamicLookup.cpp b/lib/Interpreter/DynamicLookup.cpp index 0546ca16..e35f5392 100644 --- a/lib/Interpreter/DynamicLookup.cpp +++ b/lib/Interpreter/DynamicLookup.cpp @@ -586,23 +586,19 @@ namespace cling { } ASTNodeInfo EvaluateTSynthesizer::VisitExpr(Expr* Node) { + bool NeedsEval = false; for (Stmt::child_iterator I = Node->child_begin(), E = Node->child_end(); I != E; ++I) { if (*I) { ASTNodeInfo NewNode = Visit(*I); assert(NewNode.hasSingleNode() && "Cannot have more than one stmt at that point"); - if (NewNode.isForReplacement()) { - if (Expr *E = NewNode.getAs()) - // Assume void if still not escaped - *I = SubstituteUnknownSymbol(m_Context->VoidTy, E); - } - else { - *I = NewNode.getAsSingleNode(); - } + if (NewNode.isForReplacement()) + NeedsEval = true; + *I = NewNode.getAsSingleNode(); } } - return ASTNodeInfo(Node, 0); + return ASTNodeInfo(Node, NeedsEval); } ASTNodeInfo EvaluateTSynthesizer::VisitBinaryOperator(BinaryOperator* Node) {