aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-10-31 22:17:48 +0000
committerAnna Zaks <ganna@apple.com>2012-10-31 22:17:48 +0000
commitbbb751a1788c461bc9765ec3387536cad6b52619 (patch)
treef0a50f65df5131f0e148ca0ffd617c49495e1992 /lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
parent1cd46de4840057198607afc875fe9518a78640e1 (diff)
[analyzer] Fix a bug in SimpleStreamChecker - return after sink.
Thanks Ted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp b/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
index 4fe01c34bf..d62002c4ab 100644
--- a/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
@@ -126,8 +126,10 @@ void SimpleStreamChecker::checkPreStmt(const CallExpr *Call,
// Check if the stream has already been closed.
ProgramStateRef State = C.getState();
const StreamState *SS = State->get<StreamMap>(FileDesc);
- if (SS && SS->isClosed())
+ if (SS && SS->isClosed()) {
reportDoubleClose(FileDesc, Call, C);
+ return;
+ }
// Generate the next transition, in which the stream is closed.
State = State->set<StreamMap>(FileDesc, StreamState::getClosed());