[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] 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: > mar

[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 h

[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 clang/test/Analysis/i

[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 yo

[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 https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-09 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 322422. ASDenysPetrov added a comment. Updated. Unlinked parent revision D95799 from the stack. Made corresponding changes in this patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/ https://revie

[PATCH] D86533: (Urgent!) [release][docs][analyzer] Add 11.0.0. release notes

2021-02-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/docs/ReleaseNotes.rst:453 + equal or known to be non-equal. + +- Added :ref:`on-demand parsing ` capability to Cross Translation Szelethus wrote: > ASDenysPetrov wrote: > > I've added the patch "Reasoning a

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2021-02-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Hi, guys! Does anyone can review this item, except @steakhal (thanks him)? Please, look. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90157/new/ https://reviews.llvm.org/D90157 ___ cfe-commits mailing list cfe-

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal > In the upcoming days, I'm gonna schedule this on our CI. We will see the > results. Thank you. That would be great! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/ https://reviews.llvm.org/D96090 ___

[PATCH] D95808: [test] Use host platform specific error message substitution in lit tests - continued

2021-02-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov reopened this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. Hi, @abhina.sreeskantharajan. I've just updated my repo and got this patch. After your changes I caught a test fail specifically in my domain of Clang Static Analyzer. Here is out

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov reopened this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. Herald added a project: lld-macho. Herald added a reviewer: lld-macho. This patch causes fails in a bunch of test files. When I roll it back, it passes. Below you can see fail out

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. One more mention. There are a lot of popups like this which stops the process untill press OK. F15539777: test_err.png That's very annoying. Please revert or fix this patch. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2021-02-16 Thread Denys Petrov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG13f4448ae7db: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way (authored by ASDenysPetrov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revie

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-16 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D95246#2565351 , @abhina.sreeskantharajan wrote: > > Do you know what is different between your environments which is causing the > spelling to be capitalized? This might help me determine how to fix the > current h

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-16 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D95246#2566417 , @abhina.sreeskantharajan wrote: > I was curious if all of these modified testcases are now failing or only the > three you mentioned. Here is the list of the tests which fail after the patch (I haven't

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson > @ASDenysPetrov, could you provide your link command-line for one of the tools > that produces the failing message, please, e.g. llvm-ar? Here is output of running tests in llvm-ar folder: F15562458: fail_output_llvm_ar.txt

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson I'm using `cmake -GNinja ../llvm -DLLVM_LIT_ARGS=-sv -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON` for setup and `ninja` for build. Here is my CMakeCache.txt config file. F15567363: CM

[PATCH] D86465: [analyzer][solver] Redesign constraint ranges data structure

2021-02-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko Hi, I actually want this patch goes developing and be loaded. It's really the worth one. Is it abandoned? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86465/new/ https://reviews.llvm.org/D86465 ___

[PATCH] D87146: [analyzer] Implement shared semantics checks for XNU functions in PthreadLockChecker

2021-02-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal > Could you please give a few links to some documentation about the functions > you are trying to model? Yes, you a re right. I've edited the summary with the link. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87146/new/ https://reviews.llvm.

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D96090#2568431 , @steakhal wrote: > This patch preserves all previous reports as expected. That's great results! > Could you please rebase this? I'll update and rebase this patch soon. > If it depends on any parent rev

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @abhina.sreeskantharajan > Can you share the output of > > sysconfig.get_platform() Sure, >>> sysconfig.get_platform() 'win32' >>> Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95246/new/ https://reviews.ll

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 324964. ASDenysPetrov edited the summary of this revision. ASDenysPetrov added a comment. Rebased revision on top of the main branch. Minor improvements. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/ https://reviews.llvm.org/D96090

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal wrote: > This patch preserves all previous reports as expected. If this patch is technically full-baked and does not bring any harm, can we approve this it as well to move forward? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/ https

[PATCH] D95799: [analyzer] Symbolicate float values with integral casting

2021-02-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. This is just a note for me to correctly rebase it in the future: https://reviews.llvm.org/D96090?vs=321602&id=322422#toc CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95799/new/ https://reviews.llvm.org/D95799 _

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal > I would like @NoQ or someone else to also review this. Oh, I would be very pleased if our colleagues pay attention to my recent patches. But seems you are the only who helps me with this stuff 🙂 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D9

[PATCH] D97277: [analyzer] Eliminate dispatchCast, evalCastFromNonLoc and evalCastFromLoc functions from SValBuilder

2021-02-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: rnk, krememek, vsavchenko, steakhal, xazax.hun. ASDenysPetrov added a project: clang. Herald added subscribers: martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. AS

[PATCH] D97296: [analyzer] Add a new parameter ProgramStateRef to SValBuilder::evalCast function

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

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-24 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @abhina.sreeskantharajan wrote: > @ASDenysPetrov are you running python inside MSYS bash? that is installed by No, I installed Python as usual via Windows msi got from official site. Here is what I've got from Python: >>> sys.platform 'win32' >>> platform.syste

[PATCH] D97388: [analyzer] Replace StoreManager::evalIntegralCast with SValBuilder::evalCast

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

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. > This shows, for example, that the `libz.so` my build uses is located in > `/usr/lib/x86_64-linux-gnu`. By having your equivalent path, we can hopefully > confirm that the issue is caused by a different set of system libraries being > used. Hi, @jhenderson I cha

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson > Thanks (for clarity, `libz` isn't what I'm looking for, it was just an > example of how this information might be useful). As it is, I think we might > need more information still - that commandline hides which files are actually > used slightly. Co

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson > Sorry, but `-W --trace` is not the same as `-Wl,--trace`. The former is a > pair of options used by the compiler (one of which describes the files used > by the compiler). The latter is an option passed to the linker, and is what > we need. Please t

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson I think I'm done. Here is output: F15648076: linker_trace_output.txt Is it OK now? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95246/new/ https://reviews.llvm.org/D9

[PATCH] D103803: [analyzer] [NFC] Implement a wrapper SValBuilder::getCastedMemRegionVal for similar functionality on region cast

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

[PATCH] D103317: [Analyzer][engine][solver] Simplify complex constraints

2021-06-07 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko I appologize for my immaturity and for the audacity of my infantile assumptions. I admit any constructive criticism. Thank you for referencing the theory. I will thoroughly study the domain in all. As for the **assignments** and why I brought them up,

[PATCH] D103803: [analyzer] [NFC] Implement a wrapper SValBuilder::getCastedMemRegionVal for similar functionality on region cast

2021-06-08 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 rGd3a6181e82ca: [analyzer] [NFC] Implement a wrapper SValBuilder::getCastedMemRegionVal for… (authored by ASDenysPetrov). Repository: rG LLVM Githu

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

2021-06-08 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 350579. ASDenysPetrov added a comment. Added a boolean option `handle-integral-cast-for-ranges` under `-analyzer-config` flag. Disabled the feature by default. @Noq, @steakhal How do you think whether it's neccesory to add any changes in `SMTConstrai

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

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

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

2021-06-16 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. What about this patch? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103096/new/ https://reviews.llvm.org/D103096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[PATCH] D104381: [analyzer] Added a test case for PR46264

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

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

2021-06-16 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D103096#2821750 , @vsavchenko wrote: > Hey, great work! I think that casts are extremely important, but it looks > like you mixed so many things into this patch. Let's make one step at a time > a split it into (at le

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

2021-06-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko Repled in inlines. Preparing an update. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:245-246 +/// +/// Complexity: O(N^2) +/// where N = size(What) +RangeSet c

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

2021-06-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:245-246 +/// +/// Complexity: O(N^2) +/// where N = size(What) +RangeSet castTo(RangeSet What, APSIntType Ty); ---

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

2021-06-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 352851. ASDenysPetrov added a comment. Updated. Removed `F` as flag. Replaced `goto` with closure. Detailed comments and fixed typos. @vsavchenko made changes according your suggestions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99797/new

[PATCH] D104381: [analyzer] Added a test case for PR46264

2021-06-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ: > I guess there might be some value in building an older Clang from around when > the bug was reported so that to see if the crash was indeed there and we're > not just reproducing it wrong. It would also allow us to understand where we > fixed it through b

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

2021-06-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 353954. ASDenysPetrov added a comment. Made changes according to comments. Optimized `castTo` function for each cast case. Simplified unit test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094 Files

[PATCH] D104381: [analyzer] Added a test case for PR46264

2021-06-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 353992. ASDenysPetrov added a comment. Updated due to comments. Confirm crash on commit `3ed8ebc2f6b8172bed48cc5986d3b7af4cfca1bc` from 24.05.2020. @NoQ ? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104381/new/ https://reviews.llvm.org/D104

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

2021-06-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @chrish_ericsson_atx Sorry for the late reply. Thank you for reveiwing this. > I think the presence of the initializer list in the test case is not > necessary to trigger the spurious warnings Could you please provide some test cases that you think will uncover o

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

2021-06-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I'll update tommorow. Comment at: clang/unittests/StaticAnalyzer/RangeSetTest.cpp:120 + + template const llvm::APSInt &from(T X) { +static llvm::APSInt Int = APSIntTy.getZeroValue(); vsavchenko wrote: > Default to `BaseType`

[PATCH] D104381: [analyzer] Added a test case for PR46264

2021-06-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 rGe76c008c906a: [analyzer] Added a test case for PR46264 (authored by ASDenysPetrov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2021-06-24 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 354225. ASDenysPetrov added a comment. Added assertions. Added two helper functions for `castTo` method. Moved some distinct code to them. Fixed clang-tidy complaints. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.

[PATCH] D104550: [analyzer] Implement getType for SVal

2021-06-24 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I'm in favor of this patch. It will help simplify `SValBuilder::evalCast`, which takes an optional parameter `OriginalTy` and acts differently based on whether it has been passed or has not. Since `sizeof(SVal)` became bigger (x1.5). I'm wondering of how much this

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

2021-06-24 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @chrish_ericsson_atx > I don't understand -- probably I don't have enough experience with analyzer > state dumps to know what I should find surprising or better in this example. Simply saying, now `ptr[3]` returns value `4` as expected, but `arr[1][1]` still retu

[PATCH] D104550: [analyzer] Implement getType for SVal

2021-06-24 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. > I'm not sure what you mean here. If it is about this particular patch, it > simply adds a non-virtual method to SVal, it shouldn't affect sizeof(SVal) at > all. My fault. For some reason I thought you added a QualType as a member to SVal declaration. > I wante

[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 clang/test/Analysis/initia

[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 https://lists.llvm.org/cgi-bin/mailman/listinfo

[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 clang/test/Analysis/initialization.

[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. ASDenys

[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 cfe-commits@lists.llvm.o

[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 https://reviews.llvm.org/D

[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 In

[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 r

[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 clang/test/Analysis/initia

[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] 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: clang/

[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: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics

[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 htt

[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: clang/lib/StaticAnalyzer

[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 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-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. I've

[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: clang/lib/StaticAnalyzer/Core/H

[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 cf

[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] 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 https://revie

[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 https://lists.llvm.org/cgi-bin/mailman/

[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 clang/

[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] 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 clang/t

[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: clang/lib/StaticAnalyzer/Core/RegionSto

[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 clang/include/c

[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 r

[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 ac

[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 = &arr[0]

[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 //REQ

[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 = &arr[0][0]; int *ptr2 = &arr[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 Standar

[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 analyzer's HTML report for IE support. (authored by ASDenysPetrov). Changed prior to commit: https://reviews.llvm.org/D107366?vs=364418&id=366923#toc Reposito

[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 s

[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 htt

[PATCH] D104550: [analyzer] Implement getType for SVal

2021-06-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SVals.cpp:154 + Optional VisitLocGotoLabel(loc::GotoLabel GL) { +return QualType{Context.VoidPtrTy}; + } NoQ wrote: > ASDenysPetrov wrote: > > vsavchenko wrote: > > > ASDenysPetr

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

2021-06-29 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @chrish_ericsson_atx Thanks for the new test case. I'll handle it ASAP. > To be clear, neither this new reproducer nor the one I originally posted fail > if commit b30521c28a4d > is > reverted.

[PATCH] D104381: [analyzer] Added a test case for PR46264

2021-07-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D104381#2838902 , @NoQ wrote: > I bisected. This bug was fixed intentionally by D85817 > , forgot to close I guess. Wow! Nice! It seems that we've duplicated the test file. I think we sh

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

2021-07-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I will update the patch soon according to your suggestions. Comment at: clang/test/Analysis/bool-assignment.c:46-50 #ifdef ANALYZER_CM_Z3 BOOL x = y; // expected-warning {{Assignment of a non-Boolean value}} #else -BOOL x = y; // no-war

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

2021-07-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/test/Analysis/produce-symbolcast.cpp:1 +// RUN: %clang_analyze_cc1 -analyzer-checker=debug.ExprInspection -analyzer-config handle-integral-cast-for-ranges=true -verify %s + steakhal wrote: > vsavchenko wrote

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

2021-07-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D105340#2855387 , @vsavchenko wrote: > Also, although the test is very extensive, it is pretty lopsided at the same > time. C-style cast is only one case out of the myriad of all explicit and, > more importantly, impl

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

2021-07-06 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 356668. ASDenysPetrov added a comment. Splitted this revision and moved `SValBuilder` related changes to separate patch D105340 . Added detailed comments. Made `NominalTypeList` //static// and as a result removed the f

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

2021-07-06 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I found some issues. Working on improvement. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2797-2799 +ProgramStateRef +RangeConstraintManager::updateExistingConstraints(ProgramStateRef State, +

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

2021-07-06 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2801-2802 + // Get a root symbol in case of SymbolCast. + while (isa(Sym)) +Sym = cast(Sym)->getOperand(); + vsavchenko wrote: > ASDenysPetrov wrote: >

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

2021-07-08 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 357240. ASDenysPetrov added a comment. Added `SymExpr::ignoreCasts` method. Added descriptive comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103096/new/ https://reviews.llvm.org/D103096 Files: clang/include/clang/StaticAnalyzer/Che

<    1   2   3   4   5   6   7   >