aboutsummaryrefslogtreecommitdiff
path: root/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
commita4a1759ba11892b510a3b09ad8605aa82602d33e (patch)
treea495f27bf803e0236b5a14cd32c277cecfb9ba15 /lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parentc9c3907e66659e4457593fdec4a27c671c12e041 (diff)
Tighten code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/MallocChecker.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index cfbcc53c17..56b338fd4c 100644
--- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/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;