summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-01-04 19:04:36 +0000
committerTed Kremenek <kremenek@apple.com>2013-01-04 19:04:36 +0000
commit7505b5a64cd1de60d5b9bb9361c53c7eb7ff489e (patch)
tree75b08bb6a42ceb353011947568470a8369642d40 /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parent6aede697c90a0a492727f55a67052a224690eea3 (diff)
downloadbcm5719-llvm-7505b5a64cd1de60d5b9bb9361c53c7eb7ff489e.tar.gz
bcm5719-llvm-7505b5a64cd1de60d5b9bb9361c53c7eb7ff489e.zip
Tighten code. No functionality change.
llvm-svn: 171501
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index cfbcc53c17d..56b338fd4ca 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -1500,16 +1500,16 @@ MallocChecker::MallocBugVisitor::VisitNode(const ExplodedNode *N,
// Retrieve the associated statement.
ProgramPoint ProgLoc = N->getLocation();
- if (StmtPoint *SP = dyn_cast<StmtPoint>(&ProgLoc))
+ if (StmtPoint *SP = dyn_cast<StmtPoint>(&ProgLoc)) {
S = SP->getStmt();
- else if (CallExitEnd *Exit = dyn_cast<CallExitEnd>(&ProgLoc))
+ } else if (CallExitEnd *Exit = dyn_cast<CallExitEnd>(&ProgLoc)) {
S = Exit->getCalleeContext()->getCallSite();
- // If an assumption was made on a branch, it should be caught
- // here by looking at the state transition.
- else if (BlockEdge *Edge = dyn_cast<BlockEdge>(&ProgLoc)) {
- const CFGBlock *srcBlk = Edge->getSrc();
- S = srcBlk->getTerminator();
+ } else if (BlockEdge *Edge = dyn_cast<BlockEdge>(&ProgLoc)) {
+ // If an assumption was made on a branch, it should be caught
+ // here by looking at the state transition.
+ S = Edge->getSrc()->getTerminator();
}
+
if (!S)
return 0;
OpenPOWER on IntegriCloud