summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-09-22 01:24:49 +0000
committerJordan Rose <jordan_rose@apple.com>2012-09-22 01:24:49 +0000
commit6f3d2f0acdf14b17aa0bbc79dcbe74cb687d1d1b (patch)
treefc4c0ce5683fa79b0b543fcc089624ab0a0bd04f /clang/lib/StaticAnalyzer/Core
parent106b037a85506fe22d1bb0fab92ac9e5b00e2377 (diff)
downloadbcm5719-llvm-6f3d2f0acdf14b17aa0bbc79dcbe74cb687d1d1b.tar.gz
bcm5719-llvm-6f3d2f0acdf14b17aa0bbc79dcbe74cb687d1d1b.zip
[analyzer] Look through OpaqueValueExprs when tracking a nil value.
This allows us to show /why/ a particular object is nil, even when it is wrapped in an OpaqueValueExpr. llvm-svn: 164445
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index 9bb8b8442e1..e1a93673f65 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -499,6 +499,9 @@ void bugreporter::trackNullOrUndefValue(const ExplodedNode *N, const Stmt *S,
if (!S || !N)
return;
+ if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S))
+ S = OVE->getSourceExpr();
+
ProgramStateManager &StateMgr = N->getState()->getStateManager();
// Walk through nodes until we get one that matches the statement exactly.
OpenPOWER on IntegriCloud