Page MenuHomePhabricator

ASDenysPetrov (Denys Petrov)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 17 2020, 10:23 AM (157 w, 5 d)

Recent Activity

Nov 25 2022

ASDenysPetrov updated the summary of D138319: [analyzer] Prepare structures for integral cast feature introducing.
Nov 25 2022, 2:03 AM · Restricted Project, Restricted Project

Nov 22 2022

ASDenysPetrov updated the diff for D103096: [analyzer] Implement cast for ranges of symbolic integers.

Completely reworked solution.

Nov 22 2022, 9:33 AM · Restricted Project, Restricted Project

Nov 18 2022

ASDenysPetrov requested review of D138319: [analyzer] Prepare structures for integral cast feature introducing.
Nov 18 2022, 12:21 PM · Restricted Project, Restricted Project

Oct 3 2022

ASDenysPetrov added a comment to D126481: [analyzer] Handle SymbolCast in SValBuilder.

@martong

So, the intersection should be empty in the above mentioned ambiguous case, shouldn't' it?

No. My current implementation doesn't contain this check in ConstraintAssignor in favor of the solution simplification. It'll be added in the next patches.

Oct 3 2022, 12:42 PM · Restricted Project, Restricted Project

Sep 28 2022

ASDenysPetrov added a comment to D126481: [analyzer] Handle SymbolCast in SValBuilder.

@martong

Then we can iterate onto the solution. What we could do is to collect the constants and types on the way of the cast visitation and then apply the same logic that you have in D103096.

Suppose we have found the way to handle it. But what if we find a contradiction while simplifying, like (short)(int x) = 0 and (int x) = 1. So that we would already know that it is impossible. What SVal should we return in such case? Undef? Unknown? Original one?

Sep 28 2022, 9:22 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D126481: [analyzer] Handle SymbolCast in SValBuilder.

Yeah okay. I get it now. Thank you for your patience and your time on elaborating the issue.

First, I think we'd need to fabricate a test case that shows us the bug even without applying your patch (D103096).

Then we can iterate onto the solution. What we could do is to collect the constants and types on the way of the cast visitation and then apply the same logic that you have in D103096.

Suppose we have found the way to handle it. But what if we find a contradiction while simplifying, like (short)(int x) = 0 and (int x) = 1. So that we would already know that it is impossible. What SVal should we return in such case? Undef? Unknown? Original one?

Sep 28 2022, 9:21 AM · Restricted Project, Restricted Project

Sep 27 2022

ASDenysPetrov requested changes to D126481: [analyzer] Handle SymbolCast in SValBuilder.
Sep 27 2022, 9:44 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D126481: [analyzer] Handle SymbolCast in SValBuilder.

@martong wrote:
I think you did get it. I'm not talking about range but about concrete int. And I see that the current behavior needs an improvement or rework.
Consider next code, which I used in my example:

1. void test(int x) {
2.   assert((short)x == 0);
3.   clang_analyzer_eval(x == 1);
4. }

Your patch does next:

  • on the line 3 we know that (int)(short)(int x) = 0 and (int x) = 1
  • simplify (int)(short)(int x). Try to get a constant for (short)(int x). Result is nothing because it is not presented in the range map. Continue unwrapping.
  • go deeper and simplify (short)(int x). Try to get a constant for (int x). Result is 1. Stop visiting.
  • return 1.
  • intersect the range of the original symbol (int)(short)(int x) which is 0 and the range which is returned - 1
  • result is an infeasible state.

My patch above yours does next:

  • on the line 3 we know that (int)(short)(int x) = 0 and (int x) = 1, but now we also know that (short)(int x) = 0 as an equivalent for (int)(short)(int x) due to the improvement.
  • simplify (int)(short)(int x). Try to get a constant for (short)(int x). Result is 0. Stop visiting.
  • return 0.
  • intersect the range of the original symbol (int)(short)(int x) which is 0 and the range which is returned - 0
  • result is a feasible state.

Here what I'm saying. This is not about ranges. This simplification dosn't take into account that different operands of the cast symbol may have different associated ranges or constants. And what do we have to do with them in this case?

Sep 27 2022, 9:44 AM · Restricted Project, Restricted Project

Sep 26 2022

ASDenysPetrov reopened D126481: [analyzer] Handle SymbolCast in SValBuilder.

I've just investigated this patch deeply. I think we have wrong logic here.

Sep 26 2022, 9:50 AM · Restricted Project, Restricted Project

Aug 29 2022

ASDenysPetrov added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

@manas Ping.

Aug 29 2022, 10:50 AM · Restricted Project, Restricted Project

Aug 15 2022

ASDenysPetrov added a comment to D131707: [analyzer][NFC] Cache the result of getLocationType in TypedValueRegion.
Aug 15 2022, 8:45 AM · Restricted Project, Restricted Project
ASDenysPetrov updated the diff for D131707: [analyzer][NFC] Cache the result of getLocationType in TypedValueRegion.

Add assertion accroding to the remark.

Aug 15 2022, 8:45 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D131707: [analyzer][NFC] Cache the result of getLocationType in TypedValueRegion.

@steakhal
Thank you for the review.
Could you please do testing for me, since I'm on Windows and have no prepared testing environment as I know you do.
I'll add an assertion.

Aug 15 2022, 8:39 AM · Restricted Project, Restricted Project

Aug 11 2022

ASDenysPetrov retitled D131707: [analyzer][NFC] Cache the result of getLocationType in TypedValueRegion from [analyzer]{NFC} Cache the result of getLocationType in TypedValueRegion to [analyzer][NFC] Cache the result of getLocationType in TypedValueRegion.
Aug 11 2022, 11:40 PM · Restricted Project, Restricted Project
ASDenysPetrov requested review of D131707: [analyzer][NFC] Cache the result of getLocationType in TypedValueRegion.
Aug 11 2022, 11:41 AM · Restricted Project, Restricted Project
ASDenysPetrov committed rGadcd4b1c0bd4: [analyzer] [NFC] Fix comments into more regular form. (authored by ASDenysPetrov).
[analyzer] [NFC] Fix comments into more regular form.
Aug 11 2022, 11:28 AM · Restricted Project, Restricted Project

Aug 10 2022

ASDenysPetrov committed rG7e2b995e0cce: [analyzer] [NFC] Add more test cases for equality tracking (authored by ASDenysPetrov).
[analyzer] [NFC] Add more test cases for equality tracking
Aug 10 2022, 9:53 AM · Restricted Project, Restricted Project
ASDenysPetrov closed D131514: [analyzer] [NFC] Add more test cases for equality tracking.
Aug 10 2022, 9:53 AM · Restricted Project, Restricted Project
ASDenysPetrov updated the diff for D131514: [analyzer] [NFC] Add more test cases for equality tracking.

C-standard does not support templates. Replaced function template with the function.

Aug 10 2022, 9:47 AM · Restricted Project, Restricted Project
ASDenysPetrov retitled D131514: [analyzer] [NFC] Add more test cases for equality tracking from [analyzer] {NFC} Add more test cases for equality tracking to [analyzer] [NFC] Add more test cases for equality tracking.
Aug 10 2022, 9:17 AM · Restricted Project, Restricted Project

Aug 9 2022

ASDenysPetrov requested review of D131514: [analyzer] [NFC] Add more test cases for equality tracking.
Aug 9 2022, 11:24 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D130372: [analyzer] Add a new factory function RangeSet::Factory::invert.

The motivation for this revision is lost due to the logical mistake in the later. However, this revision could be used for other improvements in the future. I will not merge it until new motivation has become.

Aug 9 2022, 11:12 AM · Restricted Project, Restricted Project
ASDenysPetrov abandoned D131006: [analyzer] Use DisequalityMap while inferring constraints.
Aug 9 2022, 11:08 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D131006: [analyzer] Use DisequalityMap while inferring constraints.

@martong
This solution has an essential logical mistake. It relies on the erroneous assumption that
if x > 0 && x != y then y is in range [MIN, 0] but that's not true.
x and y could be 1 and 2 respectively.

Aug 9 2022, 10:59 AM · Restricted Project, Restricted Project

Aug 5 2022

ASDenysPetrov added a comment to D130372: [analyzer] Add a new factory function RangeSet::Factory::invert.

Thank you. I prefer to load this along with the motivation part D131006.

Aug 5 2022, 11:51 AM · Restricted Project, Restricted Project

Aug 4 2022

ASDenysPetrov added a comment to D131006: [analyzer] Use DisequalityMap while inferring constraints.

Awesome!

Thank you!

Aug 4 2022, 9:50 AM · Restricted Project, Restricted Project

Aug 3 2022

ASDenysPetrov added inline comments to D130372: [analyzer] Add a new factory function RangeSet::Factory::invert.
Aug 3 2022, 11:14 AM · Restricted Project, Restricted Project

Aug 2 2022

ASDenysPetrov added a comment to D130372: [analyzer] Add a new factory function RangeSet::Factory::invert.

@martong

Now I'm working on the next patch and you'll see a motivation soon.

Here is the motivation but it still causes some tests failure D131006.

Aug 2 2022, 11:51 AM · Restricted Project, Restricted Project
ASDenysPetrov requested review of D131006: [analyzer] Use DisequalityMap while inferring constraints.
Aug 2 2022, 11:45 AM · Restricted Project, Restricted Project

Jul 27 2022

ASDenysPetrov updated the diff for D130372: [analyzer] Add a new factory function RangeSet::Factory::invert.

Make changes according to the remarks.

  • Add complexity to function description.
  • Rewrite the loop making it deterministic.
  • Add back invert operation to the tests.
Jul 27 2022, 2:29 PM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D130372: [analyzer] Add a new factory function RangeSet::Factory::invert.

Now I'm working on the next patch and you'll see a motivation soon.

Jul 27 2022, 12:58 PM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D130372: [analyzer] Add a new factory function RangeSet::Factory::invert.

@martong Thanks for review.

Jul 27 2022, 12:57 PM · Restricted Project, Restricted Project

Jul 22 2022

ASDenysPetrov requested review of D130372: [analyzer] Add a new factory function RangeSet::Factory::invert.
Jul 22 2022, 10:17 AM · Restricted Project, Restricted Project

Jul 19 2022

ASDenysPetrov committed rGa364987368a1: [analyzer][NFC] Use `SValVisitor` instead of explicit helper functions (authored by ASDenysPetrov).
[analyzer][NFC] Use `SValVisitor` instead of explicit helper functions
Jul 19 2022, 1:10 PM · Restricted Project, Restricted Project
ASDenysPetrov closed D130029: [analyzer][NFC] Use `SValVisitor` instead of explicit helper functions.
Jul 19 2022, 1:10 PM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

Is there any other way to formulate the expression so that it constructs LHS = [1, 2] U [8, 9] and doesn't bifurcate?

Try this u1 > 0 && u1 < 10 && u1 != 3 && u1 != 4 && u1 != 5 && u1 != 6 && u1 != 7 && u2 > 4 && u2 < 7. This is a bit verbose but it will avoid bifurcation.

Jul 19 2022, 11:09 AM · Restricted Project, Restricted Project

Jul 18 2022

ASDenysPetrov added a comment to D130029: [analyzer][NFC] Use `SValVisitor` instead of explicit helper functions.

Why don't you use the SValVisitor instead?

@steakhal Finally fulfilled you suggestion :-)

Jul 18 2022, 10:54 AM · Restricted Project, Restricted Project
ASDenysPetrov requested review of D130029: [analyzer][NFC] Use `SValVisitor` instead of explicit helper functions.
Jul 18 2022, 10:40 AM · Restricted Project, Restricted Project

Jul 15 2022

ASDenysPetrov closed D129498: [analyzer] Add new function `clang_analyzer_value` to ExprInspectionChecker.

Closed with bc08c3cb7f8e797fee14e96eedd3dc358608ada3

Jul 15 2022, 11:50 AM · Restricted Project, Restricted Project
ASDenysPetrov committed rGbc08c3cb7f8e: [analyzer] Add new function `clang_analyzer_value` to ExprInspectionChecker (authored by ASDenysPetrov).
[analyzer] Add new function `clang_analyzer_value` to ExprInspectionChecker
Jul 15 2022, 10:07 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

I'm sorry but it seems like I brought you a new work :-) I've just loaded these two patches (D129678 and D129498) and now you have to rebase your changes. But there is a good news as well. You will be able to use clang_analyzer_value function for your tests if needed.

Jul 15 2022, 10:03 AM · Restricted Project, Restricted Project
ASDenysPetrov committed rG82f76c04774f: [analyzer][NFC] Tidy up handler-functions in SymbolicRangeInferrer (authored by ASDenysPetrov).
[analyzer][NFC] Tidy up handler-functions in SymbolicRangeInferrer
Jul 15 2022, 9:25 AM · Restricted Project, Restricted Project
ASDenysPetrov closed D129678: [analyzer][NFC] Tidy up handler-functions in SymbolicRangeInferrer.
Jul 15 2022, 9:25 AM · Restricted Project, Restricted Project

Jul 14 2022

ASDenysPetrov updated the diff for D129678: [analyzer][NFC] Tidy up handler-functions in SymbolicRangeInferrer.

Fixed a typo that caused constraint_manager_negate.c and unary-sym-expr.c tests crashes.

Jul 14 2022, 11:50 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D113004: [analyzer][docs] Add Configuration section to user-docs.

Ping

Jul 14 2022, 9:07 AM · Restricted Project
ASDenysPetrov updated the diff for D129498: [analyzer] Add new function `clang_analyzer_value` to ExprInspectionChecker.

Stick to name clang_analyzer_value.
Change function name from printRange to printValue.
Make description more precise in the documentation.

Jul 14 2022, 9:06 AM · Restricted Project, Restricted Project

Jul 13 2022

ASDenysPetrov retitled D129678: [analyzer][NFC] Tidy up handler-functions in SymbolicRangeInferrer from Tidy up handler-functions in SymbolicRangeInferrer to [analyzer][NFC] Tidy up handler-functions in SymbolicRangeInferrer.
Jul 13 2022, 11:57 AM · Restricted Project, Restricted Project
ASDenysPetrov requested review of D129678: [analyzer][NFC] Tidy up handler-functions in SymbolicRangeInferrer.
Jul 13 2022, 11:46 AM · Restricted Project, Restricted Project
ASDenysPetrov updated the diff for D129498: [analyzer] Add new function `clang_analyzer_value` to ExprInspectionChecker.

Constrained the test by adding llvm-lit REQUIRES command.
Documented a new function at https://clang.llvm.org/docs/analyzer/developer-docs/DebugChecks.html

Jul 13 2022, 10:54 AM · Restricted Project, Restricted Project

Jul 12 2022

ASDenysPetrov added a comment to D129498: [analyzer] Add new function `clang_analyzer_value` to ExprInspectionChecker.

Maybe clang_analyzer_range() instead?

Thanks for the notes, @NoQ .
This was its first name. I refused. First, because it emits concrete integers as well and moreover we can extend it for arrays or strings e.g. Second, the ranges is just an implementation detail and an actual thing we want to see is an associated value.

Please add documentation to https://clang.llvm.org/docs/analyzer/developer-docs/DebugChecks.html

I'll do.

Jul 12 2022, 11:48 PM · Restricted Project, Restricted Project

Jul 11 2022

Herald added a project to D104647: [analyzer] Support SVal::getType for pointer-to-member values: Restricted Project.

@vsavchenko Is this alive?

Jul 11 2022, 11:18 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

@manas ?

Jul 11 2022, 10:02 AM · Restricted Project, Restricted Project
ASDenysPetrov requested review of D129498: [analyzer] Add new function `clang_analyzer_value` to ExprInspectionChecker.
Jul 11 2022, 9:19 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D103096: [analyzer] Implement cast for ranges of symbolic integers.

@martong Thank you for your patience. I started moving to a bit another direction that we can improving it iteratively.
Just spoiling, in my latest solution a single symbol will be associated to many classes. Here are also tricky cases:

Jul 11 2022, 9:06 AM · Restricted Project, Restricted Project

Jul 5 2022

ASDenysPetrov accepted D129152: [Clang][unittests] Silence trucation warning with MSVC.

@aganea Thank you for fixing this.
TestValues structure implies to hold a set of values which can do some kind of convertions including truncations. This is what tests are about. That's true, it may happen that some test cases don't need some values. You can carry them out to some TestValues2 structure and use them instead. That also would work. So it's up to you. I'm OK with both solutions.

Jul 5 2022, 11:44 AM · Restricted Project, Restricted Project

Jun 27 2022

ASDenysPetrov added a comment to D103096: [analyzer] Implement cast for ranges of symbolic integers.

@martong Just FYI. I've been working on reworking this solution to using EquivalenceClasses for several weeks. It turned out that this is an extremely hard task to acomplish. There're a lot of cast cases like: (int8)x==y, (uint16)a==(int64)b, (uint8)y == b, Merging and inferring all of this without going beyond the complexity O(n) is really tricky.

Jun 27 2022, 11:15 AM · Restricted Project, Restricted Project

May 30 2022

ASDenysPetrov accepted D126481: [analyzer] Handle SymbolCast in SValBuilder.

This part of the SValBuilder is responsible for constant folding. We need this constant folding, so the engine can work with less symbols, this way it can be more efficient. Whenever a symbol is constrained with a constant then we substitute the symbol with the corresponding integer. If a symbol is constrained with a range, then the symbol is kept and we fall-back to use the range based constraint manager, which is not that efficient. This patch is the natural extension of the existing constant folding machinery with the support of SymbolCast symbols.

Now I see. Thanks. I also wouldn't mind if you add this explanation to the summary.

May 30 2022, 9:37 AM · Restricted Project, Restricted Project

May 27 2022

ASDenysPetrov added a comment to D126481: [analyzer] Handle SymbolCast in SValBuilder.

@martong As you said, my solution D103096 suppose to pass these and more other tests cases. So how it will help in combination with my solution D103096?
Although, your patch is really simple but it's more like a plug then a real SymbolCast support, isn't it? I don't quite understand the motivation.

May 27 2022, 11:14 AM · Restricted Project, Restricted Project

May 19 2022

ASDenysPetrov updated the summary of D103096: [analyzer] Implement cast for ranges of symbolic integers.
May 19 2022, 10:26 AM · Restricted Project, Restricted Project

May 13 2022

ASDenysPetrov added a comment to D103096: [analyzer] Implement cast for ranges of symbolic integers.

Ping

Thank you, folk, for taking you time. I'll surely make corresponding changes according to your suggestions and notify you then. Sorry, @martong, for the late response. I'm pretty loaded recent times.

May 13 2022, 8:38 AM · Restricted Project, Restricted Project

Apr 26 2022

ASDenysPetrov updated the diff for D103096: [analyzer] Implement cast for ranges of symbolic integers.

@martong thank you for the idea. I've tried to implement it. Could you look at the patch once again, please? I've also described a new solution in the Summary.

Apr 26 2022, 9:36 AM · Restricted Project, Restricted Project

Apr 22 2022

ASDenysPetrov added a comment to D103096: [analyzer] Implement cast for ranges of symbolic integers.

Thank you for the review @martong! Your work is not less hard than mine. I'll rework and update the revision ASAP.

Apr 22 2022, 12:40 PM · Restricted Project, Restricted Project

Apr 19 2022

ASDenysPetrov updated the diff for D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

Loaded with comment updateds according to the remarks.
@martong thank you for your time for the review!

Apr 19 2022, 10:31 PM · Restricted Project, Restricted Project
ASDenysPetrov committed rGe37726beb22a: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions… (authored by ASDenysPetrov).
[analyzer] Implemented RangeSet::Factory::castTo function to perform promotions…
Apr 19 2022, 12:34 PM · Restricted Project, Restricted Project
ASDenysPetrov closed D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.
Apr 19 2022, 12:34 PM · Restricted Project, Restricted Project

Apr 15 2022

ASDenysPetrov updated the diff for D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

Updated according to suggestions.
@martong thank you for the review.

Apr 15 2022, 6:34 AM · Restricted Project, Restricted Project
ASDenysPetrov added inline comments to D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.
Apr 15 2022, 6:10 AM · Restricted Project, Restricted Project

Apr 14 2022

Herald added a project to D113004: [analyzer][docs] Add Configuration section to user-docs: Restricted Project.
Apr 14 2022, 3:02 AM · Restricted Project

Apr 12 2022

ASDenysPetrov accepted D121387: [analyzer] ClangSA should tablegen doc urls refering to the main doc page.

Thanks! LGTM.

Apr 12 2022, 9:41 AM · Restricted Project, Restricted Project

Apr 11 2022

ASDenysPetrov accepted D122243: [analyzer][NFC] Introduce the checker package separator character.

LGTM

Apr 11 2022, 10:00 AM · Restricted Project, Restricted Project
Herald added a project to D107636: [analyzer][solver] Compute adjustment for unsupported symbols as well: Restricted Project.

I checked the tests file on the latest sources. It passes even without your changes. Maybe this patch is already outdated.

Apr 11 2022, 9:52 AM · Restricted Project, Restricted Project

Apr 7 2022

ASDenysPetrov added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

Here are my remarks.

Apr 7 2022, 9:55 AM · Restricted Project, Restricted Project

Mar 23 2022

Herald added a project to D103096: [analyzer] Implement cast for ranges of symbolic integers: Restricted Project.

Ping. If there is somebody interested in this? :)

Mar 23 2022, 10:13 AM · Restricted Project, Restricted Project
Herald added a project to D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions: Restricted Project.

Ping.

Mar 23 2022, 10:13 AM · Restricted Project, Restricted Project

Jan 27 2022

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

Paused for a while.

Jan 27 2022, 8:41 AM · Restricted Project

Jan 20 2022

ASDenysPetrov added inline comments to D117229: [Analyzer] Produce SymbolCast for pointer to integer cast.
Jan 20 2022, 9:15 AM · Restricted Project, Restricted Project
ASDenysPetrov added inline comments to D117229: [Analyzer] Produce SymbolCast for pointer to integer cast.
Jan 20 2022, 9:14 AM · Restricted Project, Restricted Project

Jan 18 2022

ASDenysPetrov committed rGd835dd4cf5cc: [analyzer] Produce SymbolCast symbols for integral types in SValBuilder… (authored by ASDenysPetrov).
[analyzer] Produce SymbolCast symbols for integral types in SValBuilder…
Jan 18 2022, 6:08 AM
ASDenysPetrov closed D105340: [analyzer] Produce SymbolCast symbols for integral types in SValBuilder::evalCast.
Jan 18 2022, 6:08 AM · Restricted Project, Restricted Project

Jan 13 2022

ASDenysPetrov added inline comments to D117229: [Analyzer] Produce SymbolCast for pointer to integer cast.
Jan 13 2022, 8:39 AM · Restricted Project, Restricted Project
ASDenysPetrov added a comment to D105340: [analyzer] Produce SymbolCast symbols for integral types in SValBuilder::evalCast.

Thank you @martong.
I'll load it ASAP. It's great to see symcasts is closer.

Jan 13 2022, 4:24 AM · Restricted Project, Restricted Project

Jan 12 2022

ASDenysPetrov added a comment to D105340: [analyzer] Produce SymbolCast symbols for integral types in SValBuilder::evalCast.

This looks great with the option flag. Landing this patch will enable more people to test the new mode and produce feedback on whether the constraint solver keeps working well enough in presence of the new symbols.

Jan 12 2022, 6:53 AM · Restricted Project, Restricted Project

Jan 11 2022

ASDenysPetrov requested review of D117035: [analyzer] Added more tests for scalars, enums and records for StrictAliasingChecker.
Jan 11 2022, 9:37 AM · Restricted Project
ASDenysPetrov requested review of D117033: [analyzer] Added more tests for scalars and enums for StrictAliasingChecker.
Jan 11 2022, 9:35 AM · Restricted Project
ASDenysPetrov updated the diff for D114718: [analyzer] Implement a new checker for Strict Aliasing Rule..

Improved the checker. Reworked tests.

Jan 11 2022, 9:33 AM · Restricted Project

Jan 10 2022

ASDenysPetrov added inline comments to D115932: [Analyzer] Create and handle SymbolCast for pointer to integral conversion.
Jan 10 2022, 4:58 AM · Restricted Project
ASDenysPetrov added inline comments to D115932: [Analyzer] Create and handle SymbolCast for pointer to integral conversion.
Jan 10 2022, 4:46 AM · Restricted Project
ASDenysPetrov added a comment to D115932: [Analyzer] Create and handle SymbolCast for pointer to integral conversion.

Starting producing SymbolCast you should be careful. It'll be helpfull for you to pay attention on my revisions D105340 and D103096 before doing this. I don't want you walk through the things I fought with. At least we've discussed to introduce a new flag support-symbolic-integer-casts to turn on/off producing the casts.

Jan 10 2022, 4:32 AM · Restricted Project

Dec 22 2021

ASDenysPetrov updated the summary of D114718: [analyzer] Implement a new checker for Strict Aliasing Rule..
Dec 22 2021, 9:53 AM · Restricted Project
ASDenysPetrov updated the diff for D114718: [analyzer] Implement a new checker for Strict Aliasing Rule..

Added more tests for records (classes, structs, unions). Improved AccessInferrer. Removed support of cast kinds such as DerivedToBase and BaseToDerived, since they are not implied in C++20 7.2.1 p11 paragraph.
TODO: White tests for multi-level casts, e.g.:

T1 a;              // a
auto* b = (T2*)&a; // {a, T2}
auto* c = (T3*)b;  // {{a, T2}, T3}
auto* d = (T4*)c;  // {{{a, T2}, T3}, T4}
auto e = *d;

TODO: Fix case with loc::ConcreteInt, e.g.:

T1 *a = nullptr;   // 0 loc
auto* b = (T2*)&a; // 0 loc
auto c = *d;       // We are not able to detect an original type and aliased type from ConcreteInt.
Dec 22 2021, 9:10 AM · Restricted Project

Dec 21 2021

ASDenysPetrov added a comment to D105340: [analyzer] Produce SymbolCast symbols for integral types in SValBuilder::evalCast.

Just a ping. I'd like to have this patch stack loaded somewhen :)

Dec 21 2021, 12:59 AM · Restricted Project, Restricted Project

Dec 20 2021

ASDenysPetrov updated the diff for D114718: [analyzer] Implement a new checker for Strict Aliasing Rule..

Improved AccessInferrer::isOppositeSign. Reworked tests.
TODO: Write more synthetic and real-world tests.

Dec 20 2021, 9:58 AM · Restricted Project

Dec 17 2021

ASDenysPetrov added a comment to D114718: [analyzer] Implement a new checker for Strict Aliasing Rule..

@steakhal Thanks! I appreciate your comprehensive comment! I'll take everything you suggested into account.

Dec 17 2021, 4:31 AM · Restricted Project
ASDenysPetrov closed D115883: [analyzer][NFC] Change return value of StoreManager::attemptDownCast function from SVal to Optional<SVal>.

Closed with rGda8bd972a33ad642d6237b5b95b31a2a20f46a35

Dec 17 2021, 3:38 AM · Restricted Project
ASDenysPetrov committed rGda8bd972a33a: [analyzer][NFC] Change return value of StoreManager::attemptDownCast function… (authored by ASDenysPetrov).
[analyzer][NFC] Change return value of StoreManager::attemptDownCast function…
Dec 17 2021, 3:04 AM
ASDenysPetrov added a comment to D115883: [analyzer][NFC] Change return value of StoreManager::attemptDownCast function from SVal to Optional<SVal>.

@xazax.hun
Many thanks for the review.

Dec 17 2021, 2:44 AM · Restricted Project

Dec 16 2021

ASDenysPetrov updated the summary of D115883: [analyzer][NFC] Change return value of StoreManager::attemptDownCast function from SVal to Optional<SVal>.
Dec 16 2021, 8:58 AM · Restricted Project
ASDenysPetrov requested review of D115883: [analyzer][NFC] Change return value of StoreManager::attemptDownCast function from SVal to Optional<SVal>.
Dec 16 2021, 8:57 AM · Restricted Project

Dec 15 2021

ASDenysPetrov added a comment to D115149: [analyzer][solver] Fix assertion on (NonLoc, Op, Loc) expressions.

@martong
Thanks for clarification.

TLDR, it is recommended to use the arcanist.

I'm not able to use arcanist. It doesn't work on Windows (at least I've tryed several ways to set up it).

Dec 15 2021, 10:58 AM · Restricted Project

Dec 14 2021

ASDenysPetrov added a comment to D115149: [analyzer][solver] Fix assertion on (NonLoc, Op, Loc) expressions.

@martong wrote:

Denis, you can see in the Revision Contents that Diff 3 has the baseline commit 63a6348. When I check out 63a6348 then the newly added test file triggers the assertion about BO_Add.

Yes is see it:


I don't get this feature. Is it a parent or something? Please explain how to interpret this table. And how can I use it myself and when?

Dec 14 2021, 9:59 AM · Restricted Project