================
@@ -763,6 +779,11 @@ void StreamChecker::evalFreadFwrite(const FnDescription 
*Desc,
     return;
   }
 
+  // At read, invalidate the buffer in any case of error or success,
+  // except if EOF was already present.
+  if (IsFread && (OldSS->ErrorState != ErrorFEof))
+    State = escapeArgs(State, C, Call, {0});
----------------
balazske wrote:

This could be a future improvement (after this patch). I am not sure if this 
works always correct, because it looks like that the `ElementCount` value at 
`fread` is used but not the "size" argument (size of one element). It is 
assumed that the specified element size is always the same as one array 
element, but this can be different.

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

Reply via email to