[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-08-04 Thread Endre Fülöp via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG141cb8a1eecc: [analyzer] Model iterator random incrementation symmetrically (authored by gamesh411). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-08-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D83190#2164361 , @gamesh411 wrote: > I experienced 2 crashes with and without this patch using commit > `1af9fc82132da7c876e8f70c4e986cc9c59010ee` on master: > I have used the clang built on that revision to analyse

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-21 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Maybe the assert `b.hasValue()` is related to the problems in D83115 or D83961 ? The changes in those affect the same functions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-21 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 added a comment. I experienced 2 crashes with and without this patch using commit `1af9fc82132da7c876e8f70c4e986cc9c59010ee` on master: I have used the clang built on that revision to analyse itself, and also used the patched version (with this current revision applied) to do the

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-17 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 278870. gamesh411 added a comment. rename Offset -> Amount inside handleRandomIncrOrDecl minor local variable renaming Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83190/new/ https://reviews.llvm.org/D83190

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-17 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 278853. gamesh411 marked an inline comment as done. gamesh411 added a comment. apply review suggestions - rename variables - remove 1 assert - rename tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-17 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 marked 6 inline comments as done. gamesh411 added a comment. Thanks for reviewing this patch this quickly! I have updated the diff according to your suggestions, but I will not land it till I run a llvm+clang analysis with it. Do you think non-ctu mode is enough to test the stability?

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware accepted this revision. baloghadamsoftware added a comment. This revision is now accepted and ready to land. Looks good, aside from the few naming issues I mentioned. Please try it on //LLVM/Clang// before committing it to avoid unexpected crashes. Comment

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-17 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 added a comment. It would be nice to see the measurements on llvm as this patch introduced some (IMO reasonable) asserts. Also in the unlikely case, there is an expression like `1 + iter`, there could be more results. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-17 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 278747. gamesh411 added a comment. rebase upon hotfix patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83190/new/ https://reviews.llvm.org/D83190 Files:

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-07 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 275954. gamesh411 added a comment. fix tidy diagnostic Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83190/new/ https://reviews.llvm.org/D83190 Files:

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 marked 5 inline comments as done. gamesh411 added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:282 +SVal = IsItOnLHS ? RVal : LVal; +handlePtrIncrOrDecr(C, ItExpr, BinaryOperator::getOverloadedOperator(OK), +

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 275835. gamesh411 added a comment. implement traditional iterator support as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83190/new/ https://reviews.llvm.org/D83190 Files:

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 added a comment. In order to test the non-pointer iterators, an extension has to be made to the system header simulator. Please check the related patch (parent of this one in the stack) https://reviews.llvm.org/D83226. Comment at:

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 275693. gamesh411 marked 2 inline comments as done. gamesh411 added a comment. rename misleading variables apply local consts Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83190/new/

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Nice work, but please implement this feature also for non-pointer iterators for the matter of consistence. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:279 +// or on the RHS (eg.: 1 + it). Both cases are modeled. +

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:267 BinaryOperatorKind OK = BO->getOpcode(); - SVal RVal = State->getSVal(BO->getRHS(), C.getLocationContext()); + Expr *LHS = BO->getLHS(); + Expr *RHS = BO->getRHS();

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 marked 2 inline comments as done. gamesh411 added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:279 +// or on the RHS (eg.: 1 + it). Both cases are modeled. +bool IsItOnLHS = BO->getLHS()->getType()->isPointerType(); +

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 updated this revision to Diff 275595. gamesh411 added a comment. remove unrelated comment formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83190/new/ https://reviews.llvm.org/D83190 Files:

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 created this revision. Herald added subscribers: cfe-commits, ASDenysPetrov, martong, steakhal, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus. Herald added a project: clang. In