summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-08-28 18:44:38 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2019-08-28 18:44:38 +0000
commit630f7daf80fe36d3aa4a9ebe60e7abefae514bba (patch)
tree476edc9fbf1518b032ec8188114f17e501780205 /clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp
parent0909a392f318872a1eacbdc9a6044cb437095a11 (diff)
downloadbcm5719-llvm-630f7daf80fe36d3aa4a9ebe60e7abefae514bba.tar.gz
bcm5719-llvm-630f7daf80fe36d3aa4a9ebe60e7abefae514bba.zip
[analyzer] Fix analyzer warnings on analyzer.
Write tests for the actual crash that was found. Write comments and refactor code around 17 style bugs and suppress 3 false positives. Differential Revision: https://reviews.llvm.org/D66847 llvm-svn: 370246
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp b/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp
index f16b2606ce4..d87e30782b7 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp
@@ -91,11 +91,13 @@ PathDiagnosticPieceRef MPIBugReporter::RequestNodeVisitor::VisitNode(
return nullptr;
const Request *const Req = N->getState()->get<RequestMap>(RequestRegion);
+ assert(Req && "The region must be tracked and alive, given that we've "
+ "just emitted a report against it");
const Request *const PrevReq =
N->getFirstPred()->getState()->get<RequestMap>(RequestRegion);
// Check if request was previously unused or in a different state.
- if ((Req && !PrevReq) || (Req->CurrentState != PrevReq->CurrentState)) {
+ if (!PrevReq || (Req->CurrentState != PrevReq->CurrentState)) {
IsNodeFound = true;
ProgramPoint P = N->getFirstPred()->getLocation();
OpenPOWER on IntegriCloud