diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-09-22 01:24:49 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-09-22 01:24:49 +0000 |
commit | 6686b6694a7998623550ff6529f2f53bfee94328 (patch) | |
tree | c1fc0203711386fc678b7f609c75241c8c973fe1 /lib/StaticAnalyzer/Core | |
parent | 85e99373835fe1b4cec624bc48dc8dfe14c2a783 (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core')
-rw-r--r-- | lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 9bb8b8442e..e1a93673f6 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/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. |