[PATCH] D111542: [analyzer] Retrieve VLA extent from its redeclaration.

2021-10-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal Thank you for your comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1663 // We can trust a const value or a value of a global initializer in main(). -const VarDecl *VD = VR->getDecl(); +const VarDecl *VD

[PATCH] D103096: [analyzer] Implement cast for ranges of symbolic integers.

2021-10-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103096/new/ https://reviews.llvm.org/D103096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D111542: [analyzer] Retrieve VLA extent from its redeclaration.

2021-10-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ @martong Guys, I've patched the bug. Could you check it? It works, but I have doubts using `VR->getDecl()->getMostRecentDecl();` as a correct way to get a right declaration. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D111542: [analyzer] Retrieve VLA extent from its redeclaration.

2021-10-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: NoQ, martong. Herald added subscribers: steakhal, manas, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. ASDenysPetrov requested review of this revision. Herald added a

[PATCH] D110913: [analyzer][solver] Handle simplification to ConcreteInt

2021-10-08 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2099-2111 + +SymbolRef SimplifiedMemberSym = nullptr; +SVal SimplifiedMemberVal = simplifyToSVal(State, MemberSym); +if (const auto CI =

[PATCH] D110913: [analyzer][solver] Handle simplification to ConcreteInt

2021-10-08 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2104 + const llvm::APSInt = CI->getValue(); + const RangeSet *ClassConstraint = getConstraint(State, Class); + // We have found a contradiction.

[PATCH] D110910: [analyzer][solver] Fix CmpOpTable handling bug

2021-10-06 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. LGTM Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1129-1134 +// We use this variable to store the last queried operator (`QueriedOP`) +// for which the `getCmpOpState` returned with `Unknown`. If there are two +

[PATCH] D110911: [analyzer][NFC] Add RangeSet::dump

2021-10-06 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov accepted this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110911/new/ https://reviews.llvm.org/D110911

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-10-06 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D104285#3044103 , @NoQ wrote: > Hey, I brought you some regressions! > >> ! In D104285#3044804 , @martong >> wrote: > > const VarDecl *VD = VR->getDecl()->getCanonicalDecl();

[PATCH] D110910: [analyzer][solver] Fix CmpOpTable handling bug

2021-10-06 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov accepted this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. I see the problem. It appears when you meet, say, '>' in a //true// branch and '<=' in a //false// branch which then turns into `>` again and trigger the flag, but shouldn't.

[PATCH] D110910: [analyzer][solver] Fix CmpOpTable handling bug

2021-10-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Thanks for mentioning me. I'll make a review of this tomorrow. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110910/new/ https://reviews.llvm.org/D110910 ___ cfe-commits

[PATCH] D99797: [analyzer] Implemented RangeSet::Factory::unite function to handle intersections and adjacency

2021-10-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Gentle ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99797/new/ https://reviews.llvm.org/D99797 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D97874: [analyzer] Improve SVal cast from integer to bool using known RangeSet

2021-10-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov abandoned this revision. ASDenysPetrov added a comment. In D97874#3014922 , @martong wrote: > @ASDenysPetrov I think the dependent patch https://reviews.llvm.org/D97296 is > too much and contains unnecessary things for this change. > > If

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-10-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 376896. ASDenysPetrov added a comment. Updated according to suggestions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107339/new/ https://reviews.llvm.org/D107339 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-10-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/test/Analysis/initialization.cpp:132 + +char const glob_arr6[5] = "123"; +void glob_array_index4() { steakhal wrote: > Ah, it's somewhat confusing. > At first, when I looked at it, I assumed that this array

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-10-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1641 + // FIXME: Take array dimension into account to prevent exceeding its size. + const int64_t I = Idx.getExtValue(); + uint32_t Code = ASDenysPetrov wrote: >

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-10-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1641 + // FIXME: Take array dimension into account to prevent exceeding its size. + const int64_t I = Idx.getExtValue(); + uint32_t Code = martong wrote: > steakhal

[PATCH] D110927: [analyzer] Access stored value of a constant array through a pointer to another type

2021-10-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D110927#3037118 , @shafik wrote: > IIUC the object is `const int arr[42]` and the `(char *)arr` is an expression > of pointer type and adding `1` to this is valid. The case you refer to in > D104285

[PATCH] D110927: [analyzer] Access stored value of a constant array through a pointer to another type

2021-10-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 376823. ASDenysPetrov added a comment. Fixed a comment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110927/new/ https://reviews.llvm.org/D110927 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp

[PATCH] D110927: [analyzer] Access stored value of a constant array through a pointer to another type

2021-10-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D110927#3036436 , @steakhal wrote: > I'm pretty sure that `int x4 = ((char*)arr)[1];` is supposed to be valid in > your summary. > I think it's allowed by the standard to access any valid object via a `char*` > -

[PATCH] D110927: [analyzer] Access stored value of a constant array through a pointer to another type

2021-10-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: aaron.ballman, martong, steakhal, NoQ, r.stahl. ASDenysPetrov added a project: clang. Herald added subscribers: manas, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun.

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D110625#3035929 , @steakhal wrote: > I thought that `SVal::getType` should return an already canonical `QualType`. > If it doesn't do that we would need to do canonicalization at each callsite, > which is less than

[PATCH] D110911: [analyzer][NFC] Add RangeSet::dump

2021-10-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D110911#3035911 , @steakhal wrote: > Please mark both of them `LLVM_DUMP_METHOD`s. This way they will be stripped > from release builds according to their documentation. And `Range::dump` as well. Repository: rG

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D110625#3035616 , @steakhal wrote: > 'using' is the same as 'typedef' AFAIK. > So, you could simply use only typedefs and implement the test in the c test > file. Seeing all the tests close together would aid

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-30 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I think we need to get canonical types. Check, please, aliased types: struct s { int v; }; using T1 = s; typedef s T2; void foo(T1 *ps) { T2 ss = *ps; ... } Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D110357: [Analyzer] Extend ConstraintAssignor to handle remainder op

2021-09-28 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/test/Analysis/constraint-assignor.c:18 + clang_analyzer_warnIfReached(); // no-warning + (void)x; // keep the constraints alive. +} steakhal wrote: > It's still mindboggling that we need to do this. This

[PATCH] D110357: [Analyzer] Extend ConstraintAssignor to handle remainder op

2021-09-28 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1603-1604 + template + bool handleRem(const SymT *Sym, RangeSet Constraint) { +// a % b != 0 implies that a != 0. steakhal wrote: > Why is this not

[PATCH] D110387: [Analyzer][NFC] Move RangeConstraintManager's def before ConstraintAssignor's def

2021-09-27 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov accepted this revision. ASDenysPetrov added a comment. LGTM. ?Should mention this as //NFC//. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110387/new/ https://reviews.llvm.org/D110387 ___

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-24 Thread Denys Petrov 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 rG98a95d4844ca: [analyzer] Retrieve a value from list initialization of constant array… (authored by ASDenysPetrov). Repository: rG LLVM Github

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @martong BTW, this patch is the first one in the stack. There are also D107339 and D108032 . You could also express your opinion there. CHANGES SINCE LAST ACTION

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @martong Thank you for your time! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104285/new/ https://reviews.llvm.org/D104285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1696-1697 + const auto I = static_cast(Idx.getExtValue()); + // Use `getZExtValue` because array extent can not be negative. + const uint64_t

[PATCH] D105340: [analyzer] Produce SymbolCast symbols for integral types in SValBuilder::evalCast

2021-09-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 374270. ASDenysPetrov added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105340/new/ https://reviews.llvm.org/D105340 Files: clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-09-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 374267. ASDenysPetrov added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h

[PATCH] D99797: [analyzer] Implemented RangeSet::Factory::unite function to handle intersections and adjacency

2021-09-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 374265. ASDenysPetrov added a comment. Rebased. Review, please. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99797/new/ https://reviews.llvm.org/D99797 Files:

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1696 + const llvm::APSInt = CI->getValue(); + const uint64_t I = static_cast(Idx.getExtValue()); + // Use `getZExtValue` because array extent

[PATCH] D108032: [analyzer] Retrieve a character from CompoundLiteralExpr as an initializer for constant arrays.

2021-09-21 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 373964. ASDenysPetrov edited the summary of this revision. ASDenysPetrov added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108032/new/ https://reviews.llvm.org/D108032 Files:

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-09-21 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 373908. ASDenysPetrov added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107339/new/ https://reviews.llvm.org/D107339 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp clang/test/Analysis/initialization.cpp

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-21 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 373895. ASDenysPetrov added a comment. Fixed nits. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104285/new/ https://reviews.llvm.org/D104285 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp clang/test/Analysis/initialization.c

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-21 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1692-1694 +const bool IsOneDimensionalArray = +!isa(CAT->getElementType()); +if (IsOneDimensionalArray) { aaron.ballman wrote:

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-21 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1696 + const llvm::APSInt = CI->getValue(); + const uint64_t I = static_cast(Idx.getExtValue()); + // Use `getZExtValue` because array extent

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-20 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1692-1694 +const bool IsOneDimensionalArray = +!isa(CAT->getElementType()); +if (IsOneDimensionalArray) { martong wrote: >

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-09-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 370611. ASDenysPetrov edited the summary of this revision. ASDenysPetrov added a comment. Adjusted the patch according to changes in the parent revision D104285 . CHANGES SINCE LAST ACTION

[PATCH] D99797: [analyzer] Implemented RangeSet::Factory::unite function to handle intersections and adjacency

2021-09-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. How about this patch and the entire stack? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99797/new/ https://reviews.llvm.org/D99797 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D107073: [analyzer] Disable direct binding from list initialization for constant arrays of local storage duration.

2021-09-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov abandoned this revision. ASDenysPetrov added a comment. This patch is currently irrelevant after last changes in the parent revision. It's going to be reworked or permanently abandoned. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107073/new/

[PATCH] D106681: [analyzer] Retrieve a value from list initialization of constant multi-dimensional array.

2021-09-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov abandoned this revision. ASDenysPetrov added a comment. This patch is currently irrelevant after last changes in the parent revision. It's going to be reworked or permanently abandoned. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106681/new/

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Now this patch supports only one-dimensional arrays. Previously there were a bug when didn't take into account array's dimension. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104285/new/ https://reviews.llvm.org/D104285

[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

2021-09-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 370284. ASDenysPetrov retitled this revision from "[analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration." to "[analyzer] Retrieve a value from list initialization of constant array declaration in a

[PATCH] D108912: [release][analyzer] Add 13.0.0 release notes

2021-09-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Here is one more related to HTML diagnostics: rG9e02f58780ab8734e5d27a0138bd477d18ae64a1 //Highlight arrows for currently selected event// Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-30 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D104285#2972215 , @martong wrote: > @ASDenysPetrov Denis, do you think it would make sense to handle the > non-multi-dimensional cases first? I see that you have useful patches in the > stack that depends on this

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-26 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 368905. ASDenysPetrov edited the summary of this revision. ASDenysPetrov added a comment. Reworked the patch according to the discussion and taking UB into account. Moved `Expr::getExprForConstArrayByRawIndex` to `RegionStoreManager`. CHANGES SINCE

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @aaron.ballman Now I'm going to rework this patch according to our disscussion. This is the first patch in the stack as you can see. And I don't want to loose the series of improvements so I will adjust it to save further patches. CHANGES SINCE LAST ACTION

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D104285#2949772 , @aaron.ballman wrote: > I don't think that compilers will create a disjointed multidimensional array, > as that would waste space at runtime. However, I do think that *optimizers* > are getting much

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-17 Thread Denys Petrov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9dabacd09fdd: [analyzer] Adjust JS code of analyzers HTML report for IE support. (authored by ASDenysPetrov). Changed prior to commit: https://reviews.llvm.org/D107366?vs=364418=366923#toc Repository:

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @aaron.ballman Let me speak some thoughts. Consider next: int arr[2][5]; int *ptr1 = [0][0]; int *ptr2 = [1][0]; The Standard tells that `ptr1[5]` is UB and `ptr2[0]` is a valid object. In practice `ptr1` and `ptr2` usually are equal. But the Standard does

[PATCH] D105167: [analyzer] Fix HTML report deduplication.

2021-08-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov accepted this revision. ASDenysPetrov added a comment. Nice work! Unfortunately I'm not able to run tests on my Windows env, but I've run you tests files manually. It works for me. P.S. BTW, is there any workarounds to make current tests supported on Windows? I know there is

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @aaron.ballman Ok, I got your concerns. As I can see we shall only reason about objects within the bounds. Otherwise, we shall return `UndefinedVal`. E.g.: int arr[2][5]; int* ptr1= (int*)arr; // Valid indexing for `ptr` is in range [0,4]. int* ptr2 =

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-16 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D104285#2943449 , @aaron.ballman wrote: > One thing I think is worth asking in this thread is whether what you're > analyzing is undefined behavior? Technically you are right. Every exit out of an array extent is UB

[PATCH] D108032: [analyzer] Retrieve a character from CompoundLiteralExpr as an initializer for constant arrays.

2021-08-13 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: NoQ, vsavchenko, steakhal, martong. ASDenysPetrov added a project: clang. Herald added subscribers: manas, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. ASDenysPetrov

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-13 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 366209. ASDenysPetrov added a comment. Fixed //smell// code: from `isa'n'cast` to `dyn-cast`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104285/new/ https://reviews.llvm.org/D104285 Files: clang/include/clang/AST/Expr.h

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-08-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 366083. ASDenysPetrov added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107339/new/ https://reviews.llvm.org/D107339 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp Index:

[PATCH] D107073: [analyzer] Disable direct binding from list initialization for constant arrays of local storage duration.

2021-08-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 366081. ASDenysPetrov added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107073/new/ https://reviews.llvm.org/D107073 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp clang/test/Analysis/initialization.c

[PATCH] D106681: [analyzer] Retrieve a value from list initialization of constant multi-dimensional array.

2021-08-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 366079. ASDenysPetrov added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106681/new/ https://reviews.llvm.org/D106681 Files: clang/lib/StaticAnalyzer/Core/MemRegion.cpp clang/lib/StaticAnalyzer/Core/RegionStore.cpp

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 366009. ASDenysPetrov added a comment. Changed according to comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104285/new/ https://reviews.llvm.org/D104285 Files: clang/include/clang/AST/Expr.h clang/include/clang/AST/Type.h

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Is it ready to load now? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107366/new/ https://reviews.llvm.org/D107366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D106152: [analyzer] Move test case to existing test file and remove duplicated test file.

2021-08-10 Thread Denys Petrov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG497b1b95e606: [analyzer] Move test case to existing test file and remove duplicated test file. (authored by ASDenysPetrov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-08-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @aaron.ballman Thanks for the review and comments. I'll update it ASAP. Comment at: clang/include/clang/AST/Expr.h:4959 + /// Return an value-expression under the given index. + /// aaron.ballman wrote: > +1

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. F18367476: report-86a04f.html - Final sample file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107366/new/ https://reviews.llvm.org/D107366 ___ cfe-commits mailing list

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 364418. ASDenysPetrov added a comment. Final fixes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107366/new/ https://reviews.llvm.org/D107366 Files: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp Index:

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D107366#2927842 , @vsavchenko wrote: > Now it captures (and makes bold) one extra arrow from the previous note. > Correct example attached! > F18364580: report-e4b488.html Damn.

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D107366#2926343 , @NoQ wrote: > Works in Firefox on macOS as well! Great! @vsavchenko , any suggestions? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107366/new/ https://reviews.llvm.org/D107366

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. F18343863: report-cdf7f5.html This is a sample file which now should work both on IE and Chromium-based browsers. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107366/new/ https://reviews.llvm.org/D107366

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 364078. ASDenysPetrov added a comment. Replaced a closure in `highlightArrowsForSelectedEvent ` with function object. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107366/new/ https://reviews.llvm.org/D107366 Files:

[PATCH] D106152: [analyzer] Move test case to existing test file and remove duplicated test file.

2021-08-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I think the patch is pretty safe, then I decided to load it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106152/new/ https://reviews.llvm.org/D106152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 364068. ASDenysPetrov added a comment. Corrected nits. Thanks to "the sharp eye" @vsavchenko =). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107366/new/ https://reviews.llvm.org/D107366 Files:

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 364030. ASDenysPetrov added a comment. Fixed the range in `range` function. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107366/new/ https://reviews.llvm.org/D107366 Files: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp Index:

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp:1352-1356 + // key 'j' + if (event.keyCode == 74) { navigateTo(/*up=*/false); - } else if (event.key == "k") { + // key 'k' + } else if (event.keyCode == 75) {

[PATCH] D107073: [analyzer] Disable direct binding from list initialization for constant arrays of local storage duration.

2021-08-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 363869. ASDenysPetrov added a comment. Fixed clang-tidy complaints. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107073/new/ https://reviews.llvm.org/D107073 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp

[PATCH] D107366: [analyzer] Adjust JS code of analyzer's HTML report for IE support.

2021-08-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: vsavchenko, NoQ. ASDenysPetrov added a project: clang. Herald added subscribers: manas, steakhal, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. ASDenysPetrov requested

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-08-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 363713. ASDenysPetrov added a comment. Added tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107339/new/ https://reviews.llvm.org/D107339 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp clang/test/Analysis/initialization.cpp

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-08-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D107339#2921896 , @vsavchenko wrote: > That looks interesting! > Can you please add tests, though? Yes, I'll add them soon. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-08-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. TODO: add regression tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107339/new/ https://reviews.llvm.org/D107339 ___ cfe-commits mailing list

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-08-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: NoQ, rsmith, martong, vsavchenko. ASDenysPetrov added a project: clang. Herald added subscribers: manas, steakhal, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun.

[PATCH] D107073: [analyzer] Disable direct binding from list initialization for constant arrays of local storage duration.

2021-08-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 363677. ASDenysPetrov added a comment. Refined code a bit. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107073/new/ https://reviews.llvm.org/D107073 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp

[PATCH] D106152: [analyzer] Move test case to existing test file and remove duplicated test file.

2021-08-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ just a ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106152/new/ https://reviews.llvm.org/D106152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D107073: [analyzer] Disable direct binding from list initialization for constant arrays of local storage duration.

2021-08-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 363454. ASDenysPetrov added a comment. Fixed clang-tidy complaints. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107073/new/ https://reviews.llvm.org/D107073 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp

[PATCH] D104285: [analyzer][AST] Retrieve value by direct index from list initialization of constant array declaration.

2021-07-29 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @martong I've added new reviewers, thanks for the prompt. > E.g. could we have a free function outside of the `InitListExpr` to implement > `getExprForConstArrayByRawIndex` It is possible, but I think this is more naturaly for the instance of `InitListExpr` to

[PATCH] D92928: [analyzer] Highlight arrows for currently selected event

2021-07-29 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov accepted this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. Let's load this patch and I will prepare the adjustment for IE in pursuit. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D107073: [analyzer] Disable direct binding from list initialization for constant arrays of local storage duration.

2021-07-29 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: NoQ, vsavchenko, steakhal, xazax.hun. ASDenysPetrov added a project: clang. Herald added subscribers: manas, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. ASDenysPetrov

[PATCH] D106739: [analyzer] Add option to SATest.py for extra checkers

2021-07-27 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @RedDocMD Could you, please, explain the motivation and add at least one test to verify it works. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106739/new/ https://reviews.llvm.org/D106739

[PATCH] D106681: [analyzer] Retrieve a value from list initialization of constant multi-dimensional array.

2021-07-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: NoQ, xazax.hun, r.stahl, chrish_ericsson_atx. ASDenysPetrov added a project: clang. Herald added subscribers: manas, steakhal, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet,

[PATCH] D92928: [analyzer] Highlight arrows for currently selected event

2021-07-20 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Or, we can find another symbiotic way. You can make changes the way without painfull part of thinking about IE. And I will prepare the next patch adjusting it. Thus, revisions would be smaller. That's would be easier for you to test all the things before the

[PATCH] D92928: [analyzer] Highlight arrows for currently selected event

2021-07-20 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D92928#2890448 , @vsavchenko wrote: > IE doesn't seem to support anything. And the majority of developers (on > Linux and on MacOS) have literally no way to test it. What we gain from > supporting IE for non-existing

[PATCH] D92928: [analyzer] Highlight arrows for currently selected event

2021-07-20 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. P.S. Sorry. My prev comments get dimmed, since I've playing with history commints, but they still are relevant. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92928/new/ https://reviews.llvm.org/D92928

[PATCH] D92928: [analyzer] Highlight arrows for currently selected event

2021-07-20 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I've made some debugging with IE. Let's keep the diagnostics IE friendly. We might not know how many users work with IE in real. Comment at: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp:1275-1283 var scrollTo = function(el) {

[PATCH] D104285: [analyzer] Retrieve value by direct index from list initialization of constant array declaration.

2021-07-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 359797. ASDenysPetrov added a comment. Fixed concern about index type being either ` int64_t` or `uint64_t`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104285/new/ https://reviews.llvm.org/D104285 Files: clang/include/clang/AST/Expr.h

[PATCH] D104285: [analyzer] Retrieve value by direct index from list initialization of constant array declaration.

2021-07-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @chrish_ericsson_atx OK. I think I found the issue. Could you please check whether it works for you? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104285/new/ https://reviews.llvm.org/D104285 ___ cfe-commits

[PATCH] D104285: [analyzer] Retrieve value by direct index from list initialization of constant array declaration.

2021-07-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 359768. ASDenysPetrov added a comment. Fixed a case mentioned by @chrish_ericsson_atx. Added the cases to the common bunch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104285/new/ https://reviews.llvm.org/D104285 Files:

[PATCH] D106152: [analyzer] Move test case to existing test file and remove duplicated test file.

2021-07-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 359710. ASDenysPetrov retitled this revision from "[analyzer] Remove test file as duplicated." to "[analyzer] Move test case to existing test file and remove duplicated test file.". ASDenysPetrov edited the summary of this revision. ASDenysPetrov added

[PATCH] D106152: [analyzer] Remove test file as duplicated.

2021-07-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D106152#2885091 , @NoQ wrote: > I have no opinion here. There's nothing wrong with having more tests and they > don't look like exact duplicates of each other(?) In D106152#2885091

<    1   2   3   4   5   6   7   >