================
@@ -1188,6 +1192,18 @@ void StreamChecker::evalSetFeofFerror(const 
FnDescription *Desc,
   C.addTransition(State);
 }
 
+void StreamChecker::preFflush(const FnDescription *Desc, const CallEvent &Call,
+                              CheckerContext &C) const {
+  // Skip if the stream is NULL/nullptr, which means flush all streams.
+  if (!Call.getArgExpr(Desc->StreamArgNo)
----------------
balazske wrote:

This check does not work in this case:
```
FILE *F = NULL;
fflush(F);
```
I think you should copy function `ensureStreamNonNull` to here and change it 
such that it makes a check for opened stream in the non-null case. In case of 
null stream no error is needed, and at unknown stream no assumption is needed 
about the non-nullness of the stream.

https://github.com/llvm/llvm-project/pull/74296
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to