Page MenuHomePhabricator

f00kat (Karasev Nikita)
Karasev Nikita

Projects

User does not belong to any projects.

User Details

User Since
Aug 6 2018, 6:07 AM (112 w, 3 d)

Recent Activity

May 11 2020

f00kat added a comment to D76996: [analyzer] Improve PlacementNewChecker.

... This draws a pattern that we should recursively descend down to the top most base region. I.e. the different check*RegionAlign methods should call into each other until we reach the top level base region.

The observation here is that the alignment of a region can be correct only if we can prove that its base region is aligned properly (and other requirements, e.g. the offset is divisible). But the base region may have another base region and we have to prove the alignment correctness to that as well.

This could be an issue not just with alignment but maybe with the size as well, I am not sure if we handle the offset properly in compound cases like this: Xi.b[0].a[1][6].

Even though the above issue is still not investigated/handled, I think this patch is now acceptable because seems like most of the practical cases are handled. We could further investigate the concern and improve in a follow-up patch.
I'd like to see this landed and thanks for your work!

May 11 2020, 12:23 PM · Restricted Project

Apr 23 2020

f00kat updated the diff for D76996: [analyzer] Improve PlacementNewChecker.
  1. Build fix
Apr 23 2020, 12:28 PM · Restricted Project
f00kat updated the diff for D76996: [analyzer] Improve PlacementNewChecker.
  1. Refactoring
  2. Build fix
Apr 23 2020, 11:21 AM · Restricted Project
f00kat updated the diff for D76996: [analyzer] Improve PlacementNewChecker.
  1. Rewroted ElementRegion processing and fixed tests for this cases.
  2. Simplified the code a bit.
Apr 23 2020, 2:41 AM · Restricted Project

Apr 19 2020

f00kat added a comment to D76996: [analyzer] Improve PlacementNewChecker.

Ping? :)

Apr 19 2020, 12:30 AM · Restricted Project

Apr 4 2020

f00kat updated the diff for D76996: [analyzer] Improve PlacementNewChecker.
  1. Maybe build fix
  2. Added tests for nested arrays of structures
  3. Fixed bugs in implementation for ElementRegion cases
Apr 4 2020, 8:28 AM · Restricted Project

Mar 31 2020

f00kat updated the diff for D76996: [analyzer] Improve PlacementNewChecker.

Fixed comments in tests

Mar 31 2020, 1:37 AM · Restricted Project

Mar 30 2020

f00kat updated the diff for D76996: [analyzer] Improve PlacementNewChecker.

test fix

Mar 30 2020, 11:24 AM · Restricted Project
f00kat updated the diff for D76996: [analyzer] Improve PlacementNewChecker.
  1. Removed code and tests for ConcreteInt cases
  2. Fixed FieldRegion check
  3. Added handling for ElementRegion cases such as
void f7() {
  short b[10];
Mar 30 2020, 10:17 AM · Restricted Project

Mar 29 2020

f00kat updated the diff for D76996: [analyzer] Improve PlacementNewChecker.

lint fixes

Mar 29 2020, 1:34 AM · Restricted Project

Mar 28 2020

f00kat created D76996: [analyzer] Improve PlacementNewChecker.
Mar 28 2020, 2:00 PM · Restricted Project

Mar 17 2020

f00kat added a comment to D76229: [clang-tidy] Added PlacementNewStorageCheck.

Have you considered making this a static analyzer check as opposed to a clang-tidy check? I think using dataflow analysis will really reduce the false positives because it will be able to track the allocation and alignment data across control flow.

I have never try to write static analyzer before. Okay, I will look at examples of how to work with dataflow.

To getting started with the Analyzer please visit @NoQ's (tiny bit outdated) booklet: https://github.com/haoNoQ/clang-analyzer-guide

Advertisement:
If D69726 lands we will have an arsenal of APIs for helping dynamic size based checkers.
If D73521 lands it should be easier to getting started with the Analyzer, but now you could visit what is our current API.

Mar 17 2020, 11:59 PM · Restricted Project, Restricted Project
f00kat added a comment to D76229: [clang-tidy] Added PlacementNewStorageCheck.

NoQ, I don`t want to say that existing static alalyzer is bad written or something. I just noticed that it does not yet support arrays and alignment.
Anyway thank you for your detailed feedback.

Mar 17 2020, 6:52 AM · Restricted Project, Restricted Project
f00kat added a comment to D76229: [clang-tidy] Added PlacementNewStorageCheck.

This seems to be already handled by clang static analyzer? (clang-analyzer-cplusplus.PlacementNew)

<source>:19:5: warning: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes [clang-analyzer-cplusplus.PlacementNew]
    ::new (&s1) long;
    ^
<source>:19:5: note: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes
<source>:64:3: warning: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes [clang-analyzer-cplusplus.PlacementNew]
  ::new (buffer3) long;
  ^

https://godbolt.org/z/9VX5WW

But it seems like not all of my tests pass on static analyzer?

I have not really worked with static analyzer code, but assuming that those cases
that are no longer diagnosed as compared to this clang-tidy checks *should* be diagnosed
(i.e. diagnosing them isn't false-positive), then i'd think that static analyzer check
simply needs some work?

Mar 17 2020, 12:08 AM · Restricted Project, Restricted Project

Mar 16 2020

f00kat added a comment to D76229: [clang-tidy] Added PlacementNewStorageCheck.

This seems to be already handled by clang static analyzer? (clang-analyzer-cplusplus.PlacementNew)

<source>:19:5: warning: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes [clang-analyzer-cplusplus.PlacementNew]
    ::new (&s1) long;
    ^
<source>:19:5: note: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes
<source>:64:3: warning: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes [clang-analyzer-cplusplus.PlacementNew]
  ::new (buffer3) long;
  ^

https://godbolt.org/z/9VX5WW

Mar 16 2020, 2:46 PM · Restricted Project, Restricted Project
f00kat added a comment to D76229: [clang-tidy] Added PlacementNewStorageCheck.

This seems to be already handled by clang static analyzer? (clang-analyzer-cplusplus.PlacementNew)

<source>:19:5: warning: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes [clang-analyzer-cplusplus.PlacementNew]
    ::new (&s1) long;
    ^
<source>:19:5: note: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes
<source>:64:3: warning: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes [clang-analyzer-cplusplus.PlacementNew]
  ::new (buffer3) long;
  ^

https://godbolt.org/z/9VX5WW

Mar 16 2020, 2:46 PM · Restricted Project, Restricted Project
f00kat added a comment to D76229: [clang-tidy] Added PlacementNewStorageCheck.

Have you considered making this a static analyzer check as opposed to a clang-tidy check? I think using dataflow analysis will really reduce the false positives because it will be able to track the allocation and alignment data across control flow.

Mar 16 2020, 2:46 PM · Restricted Project, Restricted Project
f00kat updated the diff for D76229: [clang-tidy] Added PlacementNewStorageCheck.

Fix 'const auto*' in function getDescendantValueDecl

Mar 16 2020, 7:35 AM · Restricted Project, Restricted Project
f00kat updated the diff for D76229: [clang-tidy] Added PlacementNewStorageCheck.
  1. Static functions instead of anonymous namespaces.
  2. const auto*.
  3. Added double back-ticks.
Mar 16 2020, 7:35 AM · Restricted Project, Restricted Project
f00kat created D76229: [clang-tidy] Added PlacementNewStorageCheck.
Mar 16 2020, 6:26 AM · Restricted Project, Restricted Project

Feb 27 2020

f00kat added a comment to D75159: [clang-tidy] Fix PR#37210 'Out-of-class template constructor only half-fixed with modernize-pass-by-value'.

Can you commit it please?

Feb 27 2020, 11:44 PM · Restricted Project, Restricted Project

Feb 26 2020

f00kat created D75159: [clang-tidy] Fix PR#37210 'Out-of-class template constructor only half-fixed with modernize-pass-by-value'.
Feb 26 2020, 2:34 AM · Restricted Project, Restricted Project

Feb 18 2020

f00kat added a comment to D74033: [clang-tidy] Fix PR#44620 'readability-redundant-string-cstr quick-fix causes invalid code'.

Yes, commit please. Thank you!

Feb 18 2020, 12:08 PM · Restricted Project, Restricted Project

Feb 11 2020

f00kat updated the diff for D74033: [clang-tidy] Fix PR#44620 'readability-redundant-string-cstr quick-fix causes invalid code'.
  1. Add full stops at the end of the lines.
  2. Add some static.
  3. Fix function 'checkParamDeclOfAncestorCallExprHasRValueRefType' to work well with the function pointer calls.
Feb 11 2020, 5:43 AM · Restricted Project, Restricted Project

Feb 7 2020

f00kat created D74214: [clang-tidy] Fix PR#34798 'readability-braces-around-statements breaks statements containing braces.'.
Feb 7 2020, 4:34 AM · Restricted Project, Restricted Project

Feb 5 2020

f00kat created D74033: [clang-tidy] Fix PR#44620 'readability-redundant-string-cstr quick-fix causes invalid code'.
Feb 5 2020, 2:56 AM · Restricted Project, Restricted Project

Feb 2 2020

f00kat added a comment to D73090: [clang-tidy] Fix PR#44528 'modernize-use-using and enums'.

Sorry for my english. Sometimes it's more difficult than bug fixing

Feb 2 2020, 10:17 PM · Restricted Project, Restricted Project
f00kat updated the diff for D73090: [clang-tidy] Fix PR#44528 'modernize-use-using and enums'.

Clean up

Feb 2 2020, 10:13 PM · Restricted Project, Restricted Project
f00kat updated the diff for D73090: [clang-tidy] Fix PR#44528 'modernize-use-using and enums'.
  1. clang-format
  2. Add comment for additional "files IDs equals" check
  3. Add test
Feb 2 2020, 10:25 AM · Restricted Project, Restricted Project

Jan 30 2020

f00kat updated the diff for D73090: [clang-tidy] Fix PR#44528 'modernize-use-using and enums'.
  1. Apply new tagDecl matcher
  2. Trying to fix some bug
Jan 30 2020, 7:27 AM · Restricted Project, Restricted Project
f00kat added a comment to D73090: [clang-tidy] Fix PR#44528 'modernize-use-using and enums'.

I have changed the code to work with tagDecl. It`s work fine on simple test cases such as

typedef enum { ea, eb } EnumT;
Jan 30 2020, 7:18 AM · Restricted Project, Restricted Project

Jan 28 2020

f00kat added a comment to D73464: [clang] Add TagDecl AST matcher.

LGTM! Do you need someone to commit on your behalf?

Yes, please. I don`t know how :)

I'm happy to do so, but I'm not certain what email address you'd like me to use for you (I can't quite suss it out from the phab emails). Can you let me know what address you'd like me to use for the commit attribution?

Jan 28 2020, 10:21 PM · Restricted Project
f00kat added a comment to D73464: [clang] Add TagDecl AST matcher.

LGTM! Do you need someone to commit on your behalf?

Jan 28 2020, 6:13 AM · Restricted Project

Jan 27 2020

f00kat updated the diff for D73464: [clang] Add TagDecl AST matcher.
  1. Fix Registry.cpp
  2. Generate AST Matchers doc
Jan 27 2020, 11:38 PM · Restricted Project
f00kat created D73464: [clang] Add TagDecl AST matcher.
Jan 27 2020, 5:26 AM · Restricted Project

Jan 21 2020

f00kat updated the diff for D73090: [clang-tidy] Fix PR#44528 'modernize-use-using and enums'.

Add new line in the end of file checkers/modernize-use-using.cpp

Jan 21 2020, 10:19 PM · Restricted Project, Restricted Project
f00kat created D73090: [clang-tidy] Fix PR#44528 'modernize-use-using and enums'.
Jan 21 2020, 3:07 AM · Restricted Project, Restricted Project