From: John McCall Date: Wed, 9 Nov 2011 17:10:36 +0000 (+0000) Subject: We don't add ExprWithCleanups to the CFG, and getSVal looks X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3fb5c5395d382ffd24ec2675237fa9bdff6266e;p=clang We don't add ExprWithCleanups to the CFG, and getSVal looks through it, so we should look through it for the live-values analysis as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144190 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index f0dbc532b2..3a325009d4 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -235,6 +235,10 @@ static const Stmt *LookThroughStmt(const Stmt *S) { while (S) { if (const Expr *Ex = dyn_cast(S)) S = Ex->IgnoreParens(); + if (const ExprWithCleanups *EWC = dyn_cast(S)) { + S = EWC->getSubExpr(); + continue; + } if (const OpaqueValueExpr *OVE = dyn_cast(S)) { S = OVE->getSourceExpr(); continue;