From 6f3d2f0acdf14b17aa0bbc79dcbe74cb687d1d1b Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Sat, 22 Sep 2012 01:24:49 +0000 Subject: [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 --- clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib') 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(S)) + S = OVE->getSourceExpr(); + ProgramStateManager &StateMgr = N->getState()->getStateManager(); // Walk through nodes until we get one that matches the statement exactly. -- cgit v1.2.3