[analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints
authorGabor Marton <gabor.marton@ericsson.com>
Tue, 7 Apr 2020 15:57:50 +0000 (17:57 +0200)
committerGabor Marton <gabor.marton@ericsson.com>
Fri, 29 May 2020 14:38:45 +0000 (16:38 +0200)
commit16506d789084fd037fc61d442da43dd5242872b7
tree2264d38767da887c5b42d73959256b7c5ced9a73
parent16fef6d0b46f0494c502f8fe416fe841f7b000f6
[analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints

Summary:
Once we found a matching FunctionDecl for the given summary then we
validate the given constraints against that FunctionDecl. E.g. we
validate that a NotNull constraint is applied only on arguments that
have pointer types.

This is needed because when we matched the signature of the summary we
were working with incomplete function types, i.e. some intricate type
could have been marked as `Irrelevant` in the signature.

Reviewers: NoQ, Szelethus, balazske

Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, steakhal, ASDenysPetrov, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77658
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp