summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-03-15 21:41:46 +0000
committerJordan Rose <jordan_rose@apple.com>2013-03-15 21:41:46 +0000
commitecaa7d2c3d66d9422e770d6e85f0e6dff2e710da (patch)
treec0a895a96b567f9ee917d56628ee9bf453817895 /clang/lib/StaticAnalyzer
parent755a2ffd79f5378b7140eeb3ba098ab90d92ca87 (diff)
downloadbcm5719-llvm-ecaa7d2c3d66d9422e770d6e85f0e6dff2e710da.tar.gz
bcm5719-llvm-ecaa7d2c3d66d9422e770d6e85f0e6dff2e710da.zip
[analyzer] Look through ExprWhenCleanups when trying to track a NULL.
Silences a few false positives in LLVM. llvm-svn: 177186
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index 8cd3eecf2b7..bf616b1d267 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -778,7 +778,8 @@ bool bugreporter::trackNullOrUndefValue(const ExplodedNode *N,
if (!S || !N)
return false;
- // Peel off OpaqueValueExpr.
+ if (const ExprWithCleanups *EWC = dyn_cast<ExprWithCleanups>(S))
+ S = EWC->getSubExpr();
if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S))
S = OVE->getSourceExpr();
OpenPOWER on IntegriCloud