[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2019-05-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D62525#1519868 , @NoQ wrote: > In D62525#1519475 , > @baloghadamsoftware wrote: > > > Before someone asks: `NoteTag`s are not applicable here since invalidation > > and

[PATCH] D62688: [Analyzer] Iterator Checkers - Model `empty()` method of containers

2019-05-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, gamesh411, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity. Modeling of the `empty()`

[PATCH] D62479: [Analyzer] Replace `CXXSelfAssignmentBRVisitor` with `NoteTags`

2019-05-28 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC361818: [Analyzer] Replace `CXXSelfAssignmentBRVisitor` with `NoteTags` (authored by baloghadamsoftware, committed by ). Changed prior to commit: https://reviews.llvm.org/D62479?vs=201494=201645#toc

[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2019-05-28 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Before someone asks: `NoteTag`s are not applicable here since invalidation and reaching one end of the range happens in many different places. This is also true for container emptiness. Repository: rC Clang CHANGES SINCE LAST ACTION

[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2019-06-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 204227. baloghadamsoftware added a comment. Visitors now track increments and decrements. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62525/new/ https://reviews.llvm.org/D62525 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp

[PATCH] D63080: [analyzer] Track indices of arrays

2019-06-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware requested changes to this revision. baloghadamsoftware added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1681 +trackExpressionValue( +LVNode, Arr->getIdx(),

[PATCH] D62899: [analyzer][UninitializedObjectChecker] Mark uninitialized regions as interesting.

2019-06-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Looks much better than the original one, but why did the warning move to the correct place just because marking the region as interesting? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62899/new/

[PATCH] D63080: [analyzer] Track indices of arrays

2019-06-15 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware accepted this revision. baloghadamsoftware added a comment. This revision is now accepted and ready to land. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63080/new/ https://reviews.llvm.org/D63080 ___ cfe-commits

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-06-13 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, szepet, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, gamesh411, donat.nagy, mikhail.ramalho, dmgreen, a.sidorin, zzheng, rnkovacs, xazax.hun, whisperity. For-loops with

[PATCH] D61851: [clang-tidy] New option for misc-throw-by-value-catch-by-reference

2019-05-13 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, aaron.ballman, lebedev.ri. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: gamesh411, Szelethus, rnkovacs. Herald added a project: clang. Catching trivial objects by value is not

[PATCH] D61851: [clang-tidy] New option for misc-throw-by-value-catch-by-reference

2019-05-21 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361225: [clang-tidy] New option for misc-throw-by-value-catch-by-reference (authored by baloghadamsoftware, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed

[PATCH] D61136: [Analyzer] Refactor begin and end symbol creation

2019-05-20 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361141: [Analyzer] Refactor begin and end symbol creation (authored by baloghadamsoftware, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D61851: [clang-tidy] New option for misc-throw-by-value-catch-by-reference

2019-05-20 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 200266. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61851/new/ https://reviews.llvm.org/D61851 Files: clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp

[PATCH] D61422: [clang-tidy] Extend bugprone-sizeof-expression check to detect sizeof misuse in pointer arithmetic

2019-05-02 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, aaron.ballman, lebedev.ri. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: gamesh411, Szelethus, rnkovacs. Herald added a project: clang. Some programmers tend to forget that

[PATCH] D61260: [clang-tidy] Extend bugprone-sizeof-expression to check sizeof(pointers to structures)

2019-04-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, aaron.ballman, lebedev.ri, JonasToth. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: gamesh411, rnkovacs. Herald added a project: clang. Accidentally taking the size of a

[PATCH] D61260: [clang-tidy] Extend bugprone-sizeof-expression to check sizeof(pointers to structures)

2019-05-07 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL360114: [clang-tidy] Extend bugprone-sizeof-expression to check sizeof(pointers to… (authored by baloghadamsoftware, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.

[PATCH] D61422: [clang-tidy] Extend bugprone-sizeof-expression check to detect sizeof misuse in pointer arithmetic

2019-05-02 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 197768. baloghadamsoftware added a comment. Type `int` in tests replaced by `struct S` because it has more "sugar". Check also fixed to handle this case. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61422/new/

[PATCH] D61422: [clang-tidy] Extend bugprone-sizeof-expression check to detect sizeof misuse in pointer arithmetic

2019-05-06 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE360032: [clang-tidy] Extend bugprone-sizeof-expression check to detect sizeof misuse in… (authored by baloghadamsoftware, committed by ). Repository: rCTE Clang Tools Extra CHANGES SINCE LAST

[PATCH] D61422: [clang-tidy] Extend bugprone-sizeof-expression check to detect sizeof misuse in pointer arithmetic

2019-05-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 197933. baloghadamsoftware added a comment. Dot added to the end of the comment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61422/new/ https://reviews.llvm.org/D61422 Files: clang-tidy/bugprone/SizeofExpressionCheck.cpp

[PATCH] D61422: [clang-tidy] Extend bugprone-sizeof-expression check to detect sizeof misuse in pointer arithmetic

2019-05-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D61422#1488081 , @aaron.ballman wrote: > Out of curiosity, have you run this over any large code bases to see what the > false positive and true positive rate is? Neither false, nor true positives found so far. I

[PATCH] D61422: [clang-tidy] Extend bugprone-sizeof-expression check to detect sizeof misuse in pointer arithmetic

2019-05-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D61422#1489451 , @aaron.ballman wrote: > Hmm, I am a little bit skeptical about the utility of this compared to the > expense of making the check marginally slower. However, I don't have any > specific objections

[PATCH] D61136: [Analyzer] Refactor begin and end symbol creation

2019-05-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 197980. baloghadamsoftware retitled this revision from "[Analyzer] IteratorChecker - Ensure end()>=begin() and refactor begin and end symbol creation" to "[Analyzer] Refactor begin and end symbol creation". baloghadamsoftware edited the summary of

[PATCH] D61260: [clang-tidy] Extend bugprone-sizeof-expression to check sizeof(pointers to structures)

2019-05-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: test/clang-tidy/bugprone-sizeof-expression.cpp:196 typedef const MyStruct TMyStruct; + typedef const MyStruct *PMyStruct; whisperity wrote: > While I

[PATCH] D61260: [clang-tidy] Extend bugprone-sizeof-expression to check sizeof(pointers to structures)

2019-05-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 197966. baloghadamsoftware added a comment. New tests added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61260/new/ https://reviews.llvm.org/D61260 Files: clang-tidy/bugprone/SizeofExpressionCheck.cpp

[PATCH] D49074: [Analyzer] [WIP] Basic support for multiplication and division in the constraint manager

2019-07-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I tested this on several open-source projects. Lots of false-positives disappeared. There are also some new findings, mainly new false-positives but not because of this feature but of "loops executed 0 times". CHANGES SINCE LAST ACTION

[PATCH] D64274: [analyzer] VirtualCallChecker overhaul.

2019-07-15 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Hmm, I still fail to understand the problem with the current `VirtualCall` checker. Is it unstable? Does it report many false positives? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64274/new/ https://reviews.llvm.org/D64274

[PATCH] D53701: [Analyzer] Instead of recording comparisons in interator checkers do an eager state split

2019-04-23 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC358951: [Analyzer] Instead of recording comparisons in interator checkers do an eager… (authored by baloghadamsoftware, committed by ). Changed prior to commit:

[PATCH] D61134: [Analyzer] Iterator Checkers - Do an early return after handling calls

2019-04-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, gamesh411, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet. This patch is more of a fix than a real improvement:

[PATCH] D61136: [Analyzer] IteratorChecker - Ensure end()>=begin() and refactor begin and end symbol creation

2019-04-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, gamesh411, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet. A container's `end()` is never less than its `begin().

[PATCH] D61134: [Analyzer] Iterator Checkers - Do an early return after handling calls

2019-04-26 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC359283: [Analyzer] Iterator Checkers - Do an early return after handling calls (authored by baloghadamsoftware, committed by ). Changed prior to commit:

[PATCH] D61136: [Analyzer] IteratorChecker - Ensure end()>=begin() and refactor begin and end symbol creation

2019-04-26 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D61136#1479454 , @NoQ wrote: > Aha, yup, thx! > > Do you plan to centralize other code paths on which you conjure symbols? Only in a small rework of `handleAssign()` because that is a place where we conjure a

[PATCH] D61136: [Analyzer] IteratorChecker - Ensure end()>=begin() and refactor begin and end symbol creation

2019-04-26 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:1929-1930 + + auto = State->getSymbolManager(); + auto Sym = SymMgr.conjureSymbol(E, LCtx, T, BlockCount, "end"); +

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-07-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 5 inline comments as done. baloghadamsoftware added a comment. In D64736#1585484 , @lebedev.ri wrote: > Thanks for working on this! > You want to use `clang/Analysis/Analyses/ExprMutationAnalyzer.h`. > See also: D51870

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-07-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 210070. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64736/new/ https://reviews.llvm.org/D64736 Files: clang-tidy/bugprone/BugproneTidyModule.cpp

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-07-15 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: aaron.ballman, lebedev.ri, alexfh. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: gamesh411, whisperity, mgorny. Herald added a project: clang. Although detecting infinite loops in

[PATCH] D63920: [CTU] Add support for virtual functions

2019-07-02 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Try to set analyzer option `IPAMode` to something different from its default value which is `dynamic-bifurcate` in the test file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63920/new/

[PATCH] D65382: [analyzer][NFC] Refactoring BugReporter.cpp P4.: If it can be const, make it const

2019-07-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D65382#1605572 , @NoQ wrote: > It's counter-idiomatic to pass manager objects (`ProgramStateManager`, > `SValBuilder`, etc.) as const-references because it tells you pretty much > nothing about what you can or

[PATCH] D65650: [Analyzer] Iterator Checkers - Fix for Crash on Iterator Differences

2019-08-02 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, gamesh411, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity. Iterators differences were

[PATCH] D65650: [Analyzer] Iterator Checkers - Fix for Crash on Iterator Differences

2019-08-02 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. This is an emergency patch. Please someone review this patch as soon as possible. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65650/new/ https://reviews.llvm.org/D65650 ___

[PATCH] D62893: [Analyzer] Iterator Checkers - Make range errors and invalidated access fatal

2019-08-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D62893#1608000 , @Szelethus wrote: > Makes sense! But, does any of the test cases actually test *this* particular > change? I added some reachability checks before committing. Repository: rL LLVM CHANGES

[PATCH] D62893: [Analyzer] Iterator Checkers - Make range errors and invalidated access fatal

2019-08-29 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370314: [Analyzer] Iterator Checkers - Make range errors and invalidated access fatal (authored by baloghadamsoftware, committed by ). Herald added a project: LLVM. Herald added a subscriber:

[PATCH] D67156: [Analyzer] Debug Checkers for Container and Iterator Inspection

2019-09-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I did not add debug calls to the tests of the existing iterator checkers yet, they will come in the next patch. After that I think the next step is to refactor the monolithic checker class into smaller ones: the iterator modelling into one file, and all the

[PATCH] D67156: [Analyzer] Debug Checkers for Container and Iterator Inspection

2019-09-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun. For white-box testing correct container and iterator

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-09-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 218876. baloghadamsoftware added a comment. Herald added a subscriber: srhines. Herald added a reviewer: jdoerfert. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64736/new/

[PATCH] D62893: [Analyzer] Iterator Checkers - Make range errors and invalidated access fatal

2019-07-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Gentle ping. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62893/new/ https://reviews.llvm.org/D62893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D62895: [Analyzer] Iterator Checkers - Check and simulate `std::advance`, `std::prev` and `std::next`

2019-07-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Gentle ping. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62895/new/ https://reviews.llvm.org/D62895 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D62724: [Analyzer] Iterator Checkers - Model `size()` method of containers

2019-07-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Gentle ping. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62724/new/ https://reviews.llvm.org/D62724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-07-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1743 + + if (Then->isInevitablySinking() || Else->isInevitablySinking()) +return true; xazax.hun wrote: > Do we consider a block assert like if both

[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2019-07-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Gentle ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62525/new/ https://reviews.llvm.org/D62525 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-07-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as not done. baloghadamsoftware added a comment. For me it is all the same whether to continue this patch or taking over Péter's. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63279/new/ https://reviews.llvm.org/D63279

[PATCH] D62688: [Analyzer] Iterator Checkers - Model `empty()` method of containers

2019-07-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 3 inline comments as done. baloghadamsoftware added a comment. In D62688#1549574 , @Szelethus wrote: > Hmm, an idea just popped into my head. I'm not sure whether we have a single > checker that does so much complicated (and

[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2019-07-31 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:281-282 + + // `FoundChange` becomes true when we find the statement the results in the + // current state of the

[PATCH] D65650: [Analyzer] Iterator Checkers - Fix for Crash on Iterator Differences

2019-08-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware closed this revision. baloghadamsoftware added a comment. Closed by commit: [[ https://reviews.llvm.org/rG8557f17d887a | https://reviews.llvm.org/rG8557f17d887a: [Analyzer] Iterator Checkers - Fix for Crash on Iterator Differences ]] Repository: rC Clang CHANGES SINCE

[PATCH] D50256: [Analyzer] Basic support for multiplication and division in the constraint manager (for == and != only)

2019-07-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 212153. baloghadamsoftware added a comment. Fixed error when the result of an integer division is compared to zero. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50256/new/ https://reviews.llvm.org/D50256 Files:

[PATCH] D65182: [analyzer] WIP: Add fix-it hint support.

2019-07-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Hmm, I was thinking on the same for some time but I wonder how many checkers could find the correct fixits? Maybe the removal fixits of double frees or double file closes, but I am afraid that for most of our path-sensitive checks there are no obvious

[PATCH] D49074: [Analyzer] Basic support for multiplication and division in the constraint manager

2019-07-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 212154. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D49074/new/ https://reviews.llvm.org/D49074 Files: include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h

[PATCH] D65361: [analyzer] Trust global initializers when analyzing main().

2019-07-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for working on this! I agree, we should trust global initializers in `main()` in C. Can we maybe detect whether GNU global constructors are enabled or better: used? Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:395

[PATCH] D50256: [Analyzer] Basic support for multiplication and division in the constraint manager (for == and != only)

2019-07-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: test/Analysis/multiplicative-folding.c:140-142 +clang_analyzer_eval(n == -1); //expected-warning{{FALSE}} +clang_analyzer_eval(n == 0); //expected-warning{{TRUE}} +

[PATCH] D65349: [analyzer] Be more careful with destructors of non-regions.

2019-07-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Yes, it crashes! :-) I tried it because I did not believe it, but it does. Is there any real-world use-case for casting concrete integers to class instances? How did you find this crashing case? Comment at:

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-07-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D63279#1590676 , @NoQ wrote: > /me has just noticed that this isn't D34812 . Oh, I just noticed that there was already an attempt to fix this :-) However, it seems that the review

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-07-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 210498. baloghadamsoftware added a comment. Fix wrong upload. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63279/new/ https://reviews.llvm.org/D63279 Files: lib/StaticAnalyzer/Core/LoopUnrolling.cpp test/Analysis/loop-unrolling.cpp

[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2019-07-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:1277-1292 +State = setContainerData(State, ContReg, CData->newEnd(OldEndSym)); } else {

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-07-17 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Core/LoopUnrolling.cpp:221-230 + if (BoundNumVal.isUnknown()) { +if (const auto *BoundDeclRefExpr = dyn_cast(BoundExpr)) { + // FIXME: Add

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-07-17 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 210302. baloghadamsoftware added a comment. Test case added for loop conditions written in reverse order and code fixed to make the test pass. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63279/new/ https://reviews.llvm.org/D63279

[PATCH] D63279: [Analyzer] Unroll for-loops where the upper boundary is a variable with know value

2019-07-17 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I am a bit afraid of the performance of the feature because of the extensive use of matchers. Based on my previous experiences matcher creation and disposition are expensive operations. Matchers are meant to be a kind of "static" structures created only once

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-07-17 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 210287. baloghadamsoftware added a comment. Herald added a subscriber: jfb. Tests for `volatile`, atomics and noreturn functions added. Check fixed to make these tests pass. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64736/new/

[PATCH] D50256: [Analyzer] [WIP] Basic support for multiplication and division in the constraint manager (for == and != only)

2019-07-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 211726. baloghadamsoftware added a comment. Intersecting an empty set caused an assertion. Early return inserted to prevent this. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50256/new/ https://reviews.llvm.org/D50256 Files:

[PATCH] D49074: [Analyzer] [WIP] Basic support for multiplication and division in the constraint manager

2019-07-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I evaluated this patch on different open-source projects, with Z3 refutation off and on: F9660704: MulDivEvaluation.xlsx I cannot always decide whether a bug is false positive or true positive. Most of them seem false

[PATCH] D49074: [Analyzer] [WIP] Basic support for multiplication and division in the constraint manager

2019-07-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 211727. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D49074/new/ https://reviews.llvm.org/D49074 Files: include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-07-26 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 211933. baloghadamsoftware marked 3 inline comments as done. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64736/new/ https://reviews.llvm.org/D64736 Files:

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-07-26 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 15 inline comments as done. baloghadamsoftware added a comment. Thank you for the very throughout review. I updated my patch according to your comments and tried to answer your concerns. Comment at: test/clang-tidy/bugprone-infinite-loop.cpp:156 + }

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-09-24 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL372693: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite… (authored by baloghadamsoftware,

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-09-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D64736#1680309 , @RKSimon wrote: > @baloghadamsoftware I'm sorry but I've reverted this at as rL372704 > it was causing buildbot failures in > cmake:

[PATCH] D67336: [analyzer][NFC] Introduce SuperChecker<>, a convenient alternative to Checker<> for storing subcheckers

2019-10-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D67336#1664168 , @NoQ wrote: > I have mixed feelings. Removing boilerplate is good, but the very fact that > we're legalizing this pattern indicates that our checkers will keep bloating > up, while i always wanted

[PATCH] D69948: [Checkers] Added support for freopen to StreamChecker.

2019-11-07 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for working on this. Please add comments to the code and maybe also to the tests. I could not find anything in the standards about `freopen()` with null-pointer for the stream parameter. Comment at:

[PATCH] D67156: [Analyzer] Debug Checkers for Container and Iterator Inspection

2019-11-08 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. baloghadamsoftware marked an inline comment as done. Closed by commit rG0f88caeef8f2: [Analyzer] Checker for Debugging Iterator Checkers (authored by baloghadamsoftware). Changed prior to commit:

[PATCH] D70244: [Analyzer] Iterator Checkers: Replace `UnknownVal` in comparison result by a conjured value

2019-11-14 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity. Sometimes the return value of a comparison

[PATCH] D69948: [Checkers] Added support for freopen to StreamChecker.

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware accepted this revision. baloghadamsoftware added a comment. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69948/new/ https://reviews.llvm.org/D69948 ___ cfe-commits mailing

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, aaron.ballman, gribozavr. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: mgehre, Szelethus, rnkovacs, xazax.hun, whisperity, mgorny. Herald added a project: clang. Finds cases

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1768880 , @gribozavr2 wrote: > Is this a common problem? There's a lot of silly code we could try to find, > but if people don't actually write it, then we get all downsides of > maintenance without the

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1768704 , @Eugene.Zelenko wrote: > What about new operator? May be check should have option for custom > allocators? Do you mean `new[]`. Thus e.g. `const *carr = new C[n] + 10;` instead of `const *carr =

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1769018 , @gribozavr2 wrote: > This check is quite limited. For example, if the addition is done in a > separate statement, this check wouldn't catch the problem. ASan would. That is not a simple and common

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1769018 , @gribozavr2 wrote: > ASan can help debug this issue, and more. ASan is too heavyweight for this simple problem. It does not point out the source of the issue as quickly as this simple check which

[PATCH] D71199: [clang-tidy] New check readability-prefer-initialization-list

2019-12-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, aaron.ballman. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: mgehre, Szelethus, rnkovacs, xazax.hun, mgorny. Herald added a project: clang. Finds member initializations in the

[PATCH] D71199: [clang-tidy][WIP] New check readability-prefer-initialization-list

2019-12-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 233087. baloghadamsoftware added a comment. Updated according to some comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files: clang-tools-extra/clang-tidy/readability/CMakeLists.txt

[PATCH] D70912: [Analyzer] Iterator Modeling: Print Container Data and Iterator Positions when printing the Program State

2019-12-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware closed this revision. baloghadamsoftware added a comment. Closed by commit: https://reviews.llvm.org/rG6e9c58946eee CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70912/new/ https://reviews.llvm.org/D70912 ___ cfe-commits

[PATCH] D71199: [clang-tidy][WIP] New check readability-prefer-initialization-list

2019-12-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71199#1777887 , @aaron.ballman wrote: > In D71199#1775083 , @whisperity > wrote: > > > Can you refresh my memory on whether a rule for "if init expr is constant, > >

[PATCH] D70244: [Analyzer] Iterator Checkers: Replace `UnknownVal` in comparison result by a conjured value

2019-12-11 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG855d21a03ae8: [Analyzer] Iterator Checkers: Replace `UnknownVal` in comparison result by a… (authored by baloghadamsoftware). Changed prior to commit:

[PATCH] D71001: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-06 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 232573. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/ https://reviews.llvm.org/D71001 Files:

[PATCH] D71001: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-06 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 5 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp:81-82 + diag(PtrArith->getBeginLoc(), + "pointer arithmetic is applied to the

[PATCH] D69948: [Checkers] Added support for freopen to StreamChecker.

2019-11-19 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:176 + const LocationContext *LCtx = C.getPredecessor()->getLocationContext(); + ConstraintManager = C.getConstraintManager(); + auto *CE =

[PATCH] D70320: [Analyzer] [NFC] Iterator Checkers - Separate iterator modeling and the actual checkers

2019-11-19 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:1308-1318 +ProgramStateRef removeIteratorPosition(ProgramStateRef State, const SVal ) { if (auto Reg =

[PATCH] D70912: [Analyzer] Iterator Modeling: Print Container Data and Iterator Positions when printing the Program State

2019-12-02 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 231738. baloghadamsoftware added a comment. Wrong diff uploaded. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70912/new/ https://reviews.llvm.org/D70912 Files: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp

[PATCH] D70850: [Clang-Tidy] Quick fix for bug in bugprone-macro-parentheses 43804

2019-12-01 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG497a754adeca: [Clang-Tidy] Quick fix for bug in bugprone-macro-parentheses 43804 (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D70850: [Clang-Tidy] Quick fix for bug in bugprone-macro-parentheses 43804

2019-12-01 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D70850#1764469 , @aaron.ballman wrote: > LGTM, but we may have other things to test (or bugs to fix) here. Oh yes, this check seems a bit incomplete, more statements are missing, but this particular issue was a

[PATCH] D70818: [Analyzer] Model STL Algoirthms to improve the iterator checkers

2019-11-28 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity, mgorny. baloghadamsoftware added a parent

[PATCH] D69948: [Checkers] Added support for freopen to StreamChecker.

2019-11-28 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:201 +std::tie(StateRetNotNull, StateRetNull) = +CM.assumeDual(StateStreamNull, RetVal); +if (StateRetNull) { balazske wrote: > NoQ wrote: >

[PATCH] D70850: [Clang-Tidy] Quick fix for bug in bugprone-macro-parentheses 43804

2019-11-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, aaron.ballman. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: mgehre, gamesh411, Szelethus, rnkovacs, xazax.hun, whisperity. Herald added a project: clang. Applying parentheses

[PATCH] D54149: [Analyzer] [WIP] Standard C++ library functions checker for the std::find() family

2019-11-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. The modeling framework in its current state cannot be used for detailed modeling of complex functions. Even detailed modeling (including handling of `GDM` data for checkers) of standard C functions are done manually: see `C string` and `stream` checkers.

[PATCH] D49074: [Analyzer] Basic support for multiplication and division in the constraint manager

2019-11-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. We have applied this patch in our internal release and our users have used it for more than half a year without any problems: no crashes, no freezes and no suspicious false positives caused by it. CHANGES SINCE LAST ACTION

<    1   2   3   4   5   6   7   8   9   10   >