[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-30 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D77066#2062849 , @martong wrote: > - Remove SValBuilder param I failed to emphasize that the point was to remove the new `CheckerContext` parameters :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbd03ef19beb8: [analyzer] ApiModeling: Add buffer size arg constraint (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77066/new/ https:/

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:237 + SVal BufDynSize = + getDynamicSizeWithOffset(State, BufV, C.getSValBuilder()); + Szelethus wrote: > You can retrieve `SValBuilder` from

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-29 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 267216. martong marked 2 inline comments as done. martong added a comment. - Remove SValBuilder param Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77066/new/ https://reviews.llvm.org/D77066 Files: clang/inc

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-29 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus accepted this revision. Szelethus added a subscriber: balazske. Szelethus added a comment. This revision is now accepted and ready to land. LGTM! I think you could remove the extra parameter, but I don't think this warrants another round of review on my end. However, the dynamic size ch

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:249-250 + // cannot apply the constraint. Actually, other checkers like + // CallAndMessage should catch this situation earlier, because we call a + // func

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-26 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 266287. martong marked 4 inline comments as done. martong added a comment. - Add assert - Create the BufferSize arg constraints in a more readable way Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77066/new/ ht

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-06 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. I'm not familiar enough with `DynamicSize.cpp` to judge the changes there, but aside from a few nits, this LGTM. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:249-250 + // cannot apply the constraint. Actually, ot

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 262095. martong added a comment. - Rebase to master Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77066/new/ https://reviews.llvm.org/D77066 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/Dynam

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-05-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77066/new/ https://reviews.llvm.org/D77066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-04-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D77066#1953280 , @Charusso wrote: > Please avoid to stuff in `CheckerContext` because this facility should be > used by ExprEngine/Store as well. > Let us reword your API: `getDynamicSizeWithOffset(ProgramStateRef, SVal, > SV

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-04-14 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 257317. martong marked an inline comment as done. martong added a comment. - Rebase to master - Use BinaryOperator::negateComparisonOp - getBufferDynamicSize -> getDynamicSizeWithOffset Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-04-09 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:253 + + // FIXME Implement a generic negate for all BO values. + assert(Tmp.Op == BO_LE && "Op should be <="); -

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-04-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. In D77066#1953280 , @Charusso wrote: > getDynamicSizeWithOffset(State, MR, SVB) { > Offset = State->getStoreManager().getStaticOffset(MR, SVB); > ... > } > Hm, the MemRegion's offset should be great. I was thinking a

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-03-31 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. Please avoid to stuff in `CheckerContext` because this facility should be used by ExprEngine/Store as well. Let us reword your API: `getDynamicSizeWithOffset(ProgramStateRef, SVal, SValBuilder &)`. Of course we are trying to obtain some buffer-ish size, that is the pur

[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

2020-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: NoQ, Szelethus, Charusso, steakhal. Herald added subscribers: cfe-commits, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a project: clang.