summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2016-04-12 00:53:26 +0000
committerDevin Coughlin <dcoughlin@apple.com>2016-04-12 00:53:26 +0000
commitb40d14f3d56e9b0f1bc41f6123586d09ccd6d305 (patch)
tree872ed39b9b9e3e0fcf309a1b9ddb6df08dc5ea8f /clang/lib
parent5933eb84d36dc6f5f85507da0d61423387d20b33 (diff)
downloadbcm5719-llvm-b40d14f3d56e9b0f1bc41f6123586d09ccd6d305.tar.gz
bcm5719-llvm-b40d14f3d56e9b0f1bc41f6123586d09ccd6d305.zip
[analyzer] Fix assertion in ReturnVisitor for body-farm synthesized getters
Don't emit a path note marking the return site if the return statement does not have a valid location. This fixes an assertion failure I introduced in r265839. llvm-svn: 266031
Diffstat (limited to 'clang/lib')
-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 e0f014714f7..657d33fa7a3 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -324,6 +324,9 @@ public:
}
PathDiagnosticLocation L(Ret, BRC.getSourceManager(), StackFrame);
+ if (!L.isValid() || !L.asLocation().isValid())
+ return nullptr;
+
return new PathDiagnosticEventPiece(L, Out.str());
}
OpenPOWER on IntegriCloud