aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index 4ada636e8e..995ef264eb 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -418,8 +418,10 @@ static void GenerateMinimalPathDiagnostic(PathDiagnostic& PD,
assert(!PD.getActivePath().empty());
PathDiagnosticCallPiece *C =
dyn_cast<PathDiagnosticCallPiece>(PD.getActivePath().front());
- if (!C)
- C = PathDiagnosticCallPiece::construct(PD.getActivePath());
+ if (!C) {
+ const Decl *Caller = CE->getLocationContext()->getDecl();
+ C = PathDiagnosticCallPiece::construct(PD.getActivePath(), Caller);
+ }
C->setCallee(*CE, SMgr);
continue;
}
@@ -1064,8 +1066,10 @@ static void GenerateExtensivePathDiagnostic(PathDiagnostic& PD,
// a new PathDiagnosticCallPiece.
PathDiagnosticCallPiece *C =
dyn_cast<PathDiagnosticCallPiece>(PD.getActivePath().front());
- if (!C)
- C = PathDiagnosticCallPiece::construct(PD.getActivePath());
+ if (!C) {
+ const Decl * Caller = CE->getLocationContext()->getDecl();
+ C = PathDiagnosticCallPiece::construct(PD.getActivePath(), Caller);
+ }
C->setCallee(*CE, SM);
EB.addContext(CE->getCallExpr());
break;