[PATCH] D87081: [analyzer][StdLibraryFunctionsChecker] Elaborate the summary of fread and fwrite

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 00:55:39 PDT 2020


martong added a comment.

In D87081#2256636 <https://reviews.llvm.org/D87081#2256636>, @balazske wrote:

> This checker will make an additional assumption on `fread` and `fwrite` with the ReturnValueCondition.

There is nothing new in that. This assumption described by the `.Case` has been here since the inception of this Checker. This patch does not change it. This patch adds two new argument constraints.

> The return value is constrained by `StreamChecker` too but it splits the error (if returned value is less that arg 3) and non-error cases into separate branches. I think this causes no problem because it will refine the assumption made here (if this assumption is made first) or the assumption here has no effect (if the split happened already).

Either way, this is not a problem. However, in a similar case with the CallAndMessage Checker, we decided to list the more specific Checker as a dependency. We could do that with StreamChecker too, if you think that's better that way. But I'd rather keep that as it is now, since as you suggests, it works now and will work even after this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87081/new/

https://reviews.llvm.org/D87081



More information about the cfe-commits mailing list