[clang] [analyzer]:fix valistChecker false negative in windows platform (PR #72951)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 06:08:27 PST 2023


https://github.com/DonatNagyE requested changes to this pull request.

While this commit may fix some of the false negatives, it is introducing a very general and (if I understood it correctly) semantically incorrect modeling step, so I don't think that it can be merged.

The first issue is that `isWinValistType` returns true for **all** variables declared as `char *` (including those that have nothing to do with `va_list`). If you want to limit the effects of this callback to `va_list` objects (which is probably necessary -- it would be bad if this checker e.g. influenced the modeling of string handling), you need to check the name of the typedef which is used to refer to the type.

The second issue is that that the binding
```
State = State->bindLoc(State->getLValue(D, LC), SVB.makeLoc(ER), LC);
```
is probably equivalent to saying



https://github.com/llvm/llvm-project/pull/72951


More information about the cfe-commits mailing list