[analyzer] Fix a bug in SimpleStreamChecker - return after sink.

Thanks Ted.

llvm-svn: 167176
This commit is contained in:
Anna Zaks 2012-10-31 22:17:48 +00:00
parent 48baf7a788
commit a57e8ffdba
1 changed files with 3 additions and 1 deletions

View File

@ -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());