[PATCH] D77658: [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 4 10:09:46 PDT 2020
martong marked 7 inline comments as done.
martong added inline comments.
================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:234-236
+ // The signature of a function we want to describe with a summary. This is a
+ // concessive signature, meaning there may be irrelevant types in the
+ // signature which we do not check against a function with concrete types.
----------------
Szelethus wrote:
> It might be worth putting a `TODO` here to not forget the constness methods :^)
Two types do not match if one of them is a const and the other is non-const. Is this what you're referring for?
================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:697
if (auto *FD = dyn_cast<FunctionDecl>(D)) {
- if (S.matchesSignature(FD)) {
+ if (S.Sign.matches(FD) && S.validate(FD)) {
auto Res = Map.insert({FD->getCanonicalDecl(), S});
----------------
Szelethus wrote:
> This looks a bit odd, we're checking whether the function matches, and than we validate right after? Shouldn't we just not match the `FD` if it isn't valid?
Yeah, ok, I moved the validation back into `matchesSignature`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77658/new/
https://reviews.llvm.org/D77658
More information about the cfe-commits
mailing list