From bf2f0d74a20607a06e27be41262d2273b5594935 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Tue, 23 Mar 2010 08:09:29 +0000 Subject: Clear the return expr GDM after using it. llvm-svn: 99268 --- clang/lib/Checker/GRExprEngine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/lib/Checker') diff --git a/clang/lib/Checker/GRExprEngine.cpp b/clang/lib/Checker/GRExprEngine.cpp index 553f949d87c..8ed57e70934 100644 --- a/clang/lib/Checker/GRExprEngine.cpp +++ b/clang/lib/Checker/GRExprEngine.cpp @@ -1329,6 +1329,8 @@ void GRExprEngine::ProcessCallExit(GRCallExitNodeBuilder &B) { if (ReturnedExpr) { SVal RetVal = state->getSVal(ReturnedExpr); state = state->BindExpr(CE, RetVal); + // Clear the return expr GDM. + state = state->set(0); } B.GenerateNode(state); @@ -2909,7 +2911,8 @@ void GRExprEngine::VisitReturnStmt(ReturnStmt *RS, ExplodedNode *Pred, ExplodedNodeSet &Dst) { ExplodedNodeSet Src; if (Expr *RetE = RS->getRetValue()) { - // Record the returned expression in the state. + // Record the returned expression in the state. It will be used in + // ProcessCallExit to bind the return value to the call expr. { static int Tag = 0; SaveAndRestore OldTag(Builder->Tag, &Tag); -- cgit v1.2.3