[analyzer] ApiModeling: Add buffer size arg constraint
authorGabor Marton <gabor.marton@ericsson.com>
Mon, 30 Mar 2020 15:47:48 +0000 (17:47 +0200)
committerGabor Marton <gabor.marton@ericsson.com>
Fri, 29 May 2020 14:13:57 +0000 (16:13 +0200)
commitbd03ef19beb8a3476d5cd9f744c5fba5ca287c51
tree9683f08ae67dd370e3987e4842a6600a6cdbea8b
parentd8f2814c913847b1d0e9167dce5973eea3600c7e
[analyzer] ApiModeling: Add buffer size arg constraint

Summary:
Introducing a new argument constraint to confine buffer sizes. It is typical in
C APIs that a parameter represents a buffer and another param holds the size of
the buffer (or the size of the data we want to handle from the buffer).

Reviewers: NoQ, Szelethus, Charusso, steakhal

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77066
clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h
clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
clang/lib/StaticAnalyzer/Core/DynamicSize.cpp
clang/test/Analysis/std-c-library-functions-arg-constraints.c