Page MenuHomePhabricator

gbencze (Gabor Bencze)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 10 2019, 5:58 AM (49 w, 4 d)

Recent Activity

Tue, Oct 20

gbencze added a comment to D89651: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

Should point out there is already a check for cert-oop57-cpp, added in D72488. Do these play nice with each other or should they perhaps be merged or share code?

Tue, Oct 20, 11:12 AM · Restricted Project, Restricted Project

Mon, Oct 19

gbencze added inline comments to D89649: Fix __has_unique_object_representations with no_unique_address.
Mon, Oct 19, 8:24 AM · Restricted Project

Sun, Oct 18

gbencze requested review of D89651: [clang-tidy] Add bugprone-suspicious-memory-comparison check.
Sun, Oct 18, 10:26 AM · Restricted Project, Restricted Project
gbencze requested review of D89649: Fix __has_unique_object_representations with no_unique_address.
Sun, Oct 18, 10:18 AM · Restricted Project

Jan 24 2020

gbencze added a comment to D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

ping

Jan 24 2020, 2:09 PM · Restricted Project, Restricted Project

Jan 13 2020

gbencze added a comment to D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

Another option that came to my mind is using a BitVector to (recursively) flag bits that are occupied by the fields. This solution would be slightly slower and uses more memory but is probably a lot easier to understand, maintain and more robust than the currently proposed implementation. This would also catch a few additional cases as it could also look inside unions.

Jan 13 2020, 1:24 PM · Restricted Project, Restricted Project

Jan 12 2020

gbencze added inline comments to D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.
Jan 12 2020, 3:00 AM · Restricted Project, Restricted Project
gbencze updated the diff for D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

Address (most of the) comments by @aaron.ballman

  • remove top-level const on locals
  • move declaration into if
  • pass TagDecl to diag
  • added test for operator void *
  • fixed [[no_unique_address]]
    • remove assertion that checks for overlapping fields
    • in hasPaddingBetweenFields: only do recursive call and add field size to TotalSize if not isZeroSize
    • + added tests
Jan 12 2020, 3:00 AM · Restricted Project, Restricted Project

Jan 7 2020

gbencze added a comment to D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

ping @aaron.ballman - any thoughts on the patch?

Jan 7 2020, 1:46 PM · Restricted Project, Restricted Project

Jan 2 2020

gbencze added a comment to D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

Thanks for all the feedback @JonasToth :)

Jan 2 2020, 4:13 PM · Restricted Project, Restricted Project
gbencze updated the diff for D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

Punctuation in comment

Jan 2 2020, 4:03 PM · Restricted Project, Restricted Project
gbencze updated the diff for D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

Tests: Split C/C++ tests and add 32/64bit specific test.

Jan 2 2020, 11:44 AM · Restricted Project, Restricted Project
gbencze added inline comments to D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.
Jan 2 2020, 10:08 AM · Restricted Project, Restricted Project
gbencze updated the diff for D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

Coding guide and better diagnostic message for padding comparison

Jan 2 2020, 10:08 AM · Restricted Project, Restricted Project

Dec 30 2019

gbencze updated the diff for D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

ReleaseNotes: move alias after new checks

Dec 30 2019, 1:21 AM · Restricted Project, Restricted Project

Dec 29 2019

gbencze added inline comments to D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.
Dec 29 2019, 3:43 PM · Restricted Project, Restricted Project
gbencze updated the diff for D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.

Update style based on comments.

Dec 29 2019, 3:43 PM · Restricted Project, Restricted Project
gbencze created D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check.
Dec 29 2019, 9:11 AM · Restricted Project, Restricted Project

Dec 15 2019

gbencze committed rGbbc9f6c2ef07: [clang-tidy] Add cert-oop58-cpp check The check warns when (a member of) the… (authored by gbencze).
[clang-tidy] Add cert-oop58-cpp check The check warns when (a member of) the…
Dec 15 2019, 7:31 AM
gbencze closed D70052: [clang-tidy] Add misc-mutating-copy check.
Dec 15 2019, 7:31 AM · Restricted Project, Restricted Project

Nov 25 2019

gbencze added a comment to D70052: [clang-tidy] Add misc-mutating-copy check.

Mark comments as Done.

Nov 25 2019, 4:41 AM · Restricted Project, Restricted Project

Nov 18 2019

gbencze added a comment to D70052: [clang-tidy] Add misc-mutating-copy check.

There is a ExprMutAnalyzer that is able to find mutation of expressions in general (even though it is kinda experimental still). Maybe that should be utilized somehow? I think the current implementation does not cover when the address is taken and mutation happens through pointers/references in free standing functions, does it?

On the other hand it makes the check more complicated, slower. Additionally the most cases are catched with this version, i guess.

Nov 18 2019, 3:04 PM · Restricted Project, Restricted Project
gbencze updated the diff for D70052: [clang-tidy] Add misc-mutating-copy check.

Formatting changes (curly braces, newline at EOF)
Remove incorrect flag from test

Nov 18 2019, 2:55 PM · Restricted Project, Restricted Project

Nov 17 2019

gbencze updated the diff for D70052: [clang-tidy] Add misc-mutating-copy check.

Moved check to CERT module.
Added warnings for calling mutating member functions.

Nov 17 2019, 8:02 AM · Restricted Project, Restricted Project

Nov 11 2019

gbencze updated the diff for D70052: [clang-tidy] Add misc-mutating-copy check.

Update documentation and release notes.

Nov 11 2019, 12:40 PM · Restricted Project, Restricted Project
gbencze added a comment to D70052: [clang-tidy] Add misc-mutating-copy check.

If this is CERT rule, why check is not placed in relevant module?

Nov 11 2019, 12:30 PM · Restricted Project, Restricted Project

Nov 10 2019

gbencze added a comment to D70052: [clang-tidy] Add misc-mutating-copy check.

Did you consider to warn on copy constructors/assignment operators take a their arguments by non-const reference, and suggest the user to turn them into const references? This seems like a more useful (and easier) check to me.
The link above contains Ideally, the copy operator should have an idiomatic signature. For copy constructors, that is T(const T&); and for copy assignment operators, that is T& operator=(const T&);..

The only remaining case are then mutable members which are quite rare.

Nov 10 2019, 1:05 PM · Restricted Project, Restricted Project
gbencze added a comment to D70052: [clang-tidy] Add misc-mutating-copy check.

Have you run your check over the LLVM/clang source base and seen true positives/false positives?

Nov 10 2019, 8:43 AM · Restricted Project, Restricted Project
gbencze created D70052: [clang-tidy] Add misc-mutating-copy check.
Nov 10 2019, 8:00 AM · Restricted Project, Restricted Project