[cfe-commits] r167176 - /cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp

Anna Zaks ganna at apple.com
Wed Oct 31 15:17:48 PDT 2012


Author: zaks
Date: Wed Oct 31 17:17:48 2012
New Revision: 167176

URL: http://llvm.org/viewvc/llvm-project?rev=167176&view=rev
Log:
[analyzer] Fix a bug in SimpleStreamChecker - return after sink.

Thanks Ted.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp?rev=167176&r1=167175&r2=167176&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp Wed Oct 31 17:17:48 2012
@@ -126,8 +126,10 @@
   // 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());





More information about the cfe-commits mailing list