[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2021-03-10 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbcc662484a95: [analyzer] Crash fix for alpha.cplusplus.IteratorRange (authored by baloghadamsoftware, committed by Balazs Benics ). Changed prior to commit: https://rev

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-09-21 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. Uh-oh, so you're saying that you're actively modeling every single operator `+` and `-` on every single integer in the program even when they don't represent any iterators at all? How can a raw inte

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-09-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D85424#2258886 , @steakhal wrote: > void foo(int x) { > > int uninit; > x - uninit; // will-crash > > } This is not even related to the iterators. We could check first whether `LHS` is an iterator and early exit

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-09-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 290967. baloghadamsoftware added a comment. Test added. Thank you for the test @steakhal! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85424/new/ https://reviews.llvm.org/D85424 Files: clang/lib/StaticAnalyzer/Checkers/IteratorRangeCh

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-09-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. OK, after a few hours of debugging, the test code simplifies to this: // RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core,cplusplus,alpha.cplusplus.IteratorRange -analyzer-config aggressive-binary-operation-simplification=true %s -verify void foo(int x)

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-31 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D85424#2247598 , @gamesh411 wrote: > `CReduce` did not manage to produce any meaningful result after a week worth > of runtime (more than ~2000 lines of code still remaining after reduction). > We could track this down by tra

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-31 Thread Endre Fülöp via Phabricator via cfe-commits
gamesh411 added a comment. `CReduce` did not manage to produce any meaningful result after a week worth of runtime (more than ~2000 lines of code still remaining after reduction). We could track this down by tracing the ExprEngine code that assigns the Undefined SVal but that seems a huge effor

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorRangeChecker.cpp:228 if (auto ValAsLoc = RHS.getAs()) { Value = State->getRawSVal(*ValAsLoc); } Well, it looks like your value is not necessarily a function argument. The

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D85424#2203329 , @NoQ wrote: > Tests? (edit: ok, i see, you have trouble reducing the test. yes, we > absolutely need a test, please finish with creduce/delta.) I will not commit it without tests, even if someone ac

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-07 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Tests? There should be no `UndefinedVal`s in function arguments unless you disable `core` checkers (which isn't supported). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85424/new/ https://reviews.llvm.org/D85424 ___

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. LGTM In D85424#2199471 , @baloghadamsoftware wrote: > Unfortunately, I could not create test for it. It is extremely rare that the > //Analyzer// creates an `UndefinedVal`. You can work around the issue by creating a unit-test

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-06 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Yeah, this looks straightforward, but how come you didn't manage to get a small test case? creduce gave up? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85424/new/ https://reviews.llvm.org/D85424 __

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Unfortunately, I could not create test for it. It is extremely rare that the //Analyzer// creates an `UndefinedVal`. I had the following output: 1. parser at end of file 2.While analyzing stack: #0 Calling llvm::object::BindRebaseSegInfo::

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus, gamesh411. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, martong, steakhal, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whi