summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-11-28 01:49:01 +0000
committerTed Kremenek <kremenek@apple.com>2012-11-28 01:49:01 +0000
commit18035d712518fe67d67c4632e71a3579d7ee420b (patch)
tree23df5e2f5a1b9fbf0bb72781072f877f25568c87 /clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
parent32c1350673e1cf75ad55772a6381ee3b2369f162 (diff)
downloadbcm5719-llvm-18035d712518fe67d67c4632e71a3579d7ee420b.tar.gz
bcm5719-llvm-18035d712518fe67d67c4632e71a3579d7ee420b.zip
Fix another false positive due to a CXX temporary object appearing in a C initializer.
The stop-gap here is to just drop such objects when processing the InitListExpr. We still need a better solution. Fixes <rdar://problem/12755044>. llvm-svn: 168757
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
index 00b2f4a6bee..d5a5762e98d 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
@@ -581,8 +581,10 @@ void ExprEngine::VisitInitListExpr(const InitListExpr *IE,
for (InitListExpr::const_reverse_iterator it = IE->rbegin(),
ei = IE->rend(); it != ei; ++it) {
- vals = getBasicVals().consVals(state->getSVal(cast<Expr>(*it), LCtx),
- vals);
+ SVal V = state->getSVal(cast<Expr>(*it), LCtx);
+ if (dyn_cast_or_null<CXXTempObjectRegion>(V.getAsRegion()))
+ V = UnknownVal();
+ vals = getBasicVals().consVals(V, vals);
}
B.generateNode(IE, Pred,
OpenPOWER on IntegriCloud