================ @@ -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}); ---------------- alejandro-alvarez-sonarsource wrote:
It turns out I was comparing with our downstream copy of v17, where `UpdateBufferRegionForFread` is defined. So it can be done for the case of arrays. I have double-checked with the original author and he agrees it can be upstreamed. Let me uplift the patch and then I will share it with you. 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