[analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints
authorGabor Marton <gabor.marton@ericsson.com>
Thu, 2 Apr 2020 14:59:02 +0000 (16:59 +0200)
committerGabor Marton <gabor.marton@ericsson.com>
Thu, 2 Apr 2020 15:00:11 +0000 (17:00 +0200)
commit1525232e276153e325a49372894ae52ed07351a5
treed7b7b2764288d9e116abe7fb5671fca09b08daad
parentda8eda1ab1ae97115f9ed170216ed89b69662578
[analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints

Summary:
Previously we induced a state split if there were multiple argument
constraints given for a function. This was because we called
`addTransition` inside the for loop.
The fix is to is to store the state and apply the next argument
constraint on that. And once the loop is finished we call `addTransition`.

Reviewers: NoQ, Szelethus, baloghadamsoftware

Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, C

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76790
clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
clang/test/Analysis/std-c-library-functions-arg-constraints.c