[PATCH] D75677: [Analyzer] Only add iterator note tags to the operations of the affected iterators

2020-03-17 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Herald added a subscriber: DenisDvlp. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:541-542 +BR.markInteresting(It1); +if (const auto &LCV1 = It1.ge

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-17 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 250860. baloghadamsoftware added a comment. Herald added a subscriber: ASDenysPetrov. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75842/new/ https://reviews.llvm.org/D75842 Files: clang/include/clan

[PATCH] D75360: [analyzer][NFC] Tie CheckerRegistry to CheckerManager, allow CheckerManager to be constructed for non-analysis purposes

2020-03-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Herald added a subscriber: ASDenysPetrov. Comment at: clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h:217 +mgr.template registerChecker(); } NoQ wrote: > Szelethus wrote: > > baloghadamsoftware wrot

[PATCH] D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`

2020-03-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Partially replacing D62895 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76361/new/ https://reviews.llvm.org/D76361 ___ cfe-commit

[PATCH] D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`

2020-03-18 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: ASDenysPetrov, martong, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, wh

[PATCH] D76379: [Analyzer] IteratorRangeChecker verify `std::advance()`, `std::prev()` and `std::next()`

2020-03-18 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: ASDenysPetrov, martong, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, wh

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

2020-03-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Herald added subscribers: ASDenysPetrov, martong, steakhal. Replaced by D76379 and D76361 . Repository: rC Clang CHANGES SINCE LAST ACTION http

[PATCH] D76379: [Analyzer] IteratorRangeChecker verify `std::advance()`, `std::prev()` and `std::next()`

2020-03-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. This patch replaces the verification part of D62895 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76379/new/ https://reviews.llvm.org/D76379

[PATCH] D75682: [Analyzer][StreamChecker] Introduction of stream error handling.

2020-03-19 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:29 + assert(SS->isOpened() && \ + "Create of error node failed (only way to get this state)?"); + --

[PATCH] D76379: [Analyzer] IteratorRangeChecker verify `std::advance()`, `std::prev()` and `std::next()`

2020-03-19 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 251320. baloghadamsoftware added a comment. Updated according to the comments and automatic formatting suggestions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76379/new/ https://reviews.llvm.org/D76379 Files: clang/lib/StaticAnalyze

[PATCH] D76379: [Analyzer] IteratorRangeChecker verify `std::advance()`, `std::prev()` and `std::next()`

2020-03-19 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. In D76379#1929698 , @Szelethus wrote: > The patch looks great, though I'd kindly ask you to wait a bit for someone > with a bit more experience on `SVal`-smithing ;)

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

2020-03-19 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 251391. baloghadamsoftware added a comment. Herald added a reviewer: Szelethus. Herald added subscribers: ASDenysPetrov, steakhal. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D49074/new/ https://reviews.llvm.org/D49074 Files:

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

2020-03-19 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 251389. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Herald added a reviewer: Szelethus. Herald added subscribers: ASDenysPetrov, martong, steakhal. Rebased. CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-19 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6cff2e9f7884: [Analyzer] Bugfix for CheckerRegistry (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75842/new/ https://revie

[PATCH] D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`

2020-03-20 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 251567. baloghadamsoftware added a comment. Updated according to the comments and automatic formatting suggestions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76361/new/ https://reviews.llvm.org/D76361 Files: clang/lib/StaticAnalyze

[PATCH] D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`

2020-03-20 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 9 inline comments as done. baloghadamsoftware added a comment. In D76361#1929483 , @martong wrote: > I suppose we could get this strange behavior with `std::distance` too? Would > it be worth to handle that as well here? Modeli

[PATCH] D75360: [analyzer][NFC] Tie CheckerRegistry to CheckerManager, allow CheckerManager to be constructed for non-analysis purposes

2020-03-20 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/D75360/new/ https://reviews.llvm.org/D75360 ___ cfe-commits m

[PATCH] D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'.

2020-02-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Please add tests for all the functions in the list. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72705/new/ https://reviews.llvm.org/D72705 ___ cfe-commits mailing

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-04 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/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport &BR) -> std::string { + SmallString<256> Msg; ---

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 242323. baloghadamsoftware added a comment. `const SVal &` -> `SVal` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp clang/test/A

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

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 242607. baloghadamsoftware added a comment. Updated: checker moved to alpha.cplusplus (until at least one of the iterator-related checkers gets out of alpha state or a new non-alpha container checker is created). Error-branch is protected by an op

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

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 3 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp:138-139 + SVB.getConditionType()); +assert(Less.getAs() && + "Symbol co

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

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb198f16e1e1c: [Analyzer] Model STL Algoirthms to improve the iterator checkers (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D70818?vs=242607&id=242647#toc Reposit

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

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 5 inline comments as done. baloghadamsoftware added a comment. In D70818#1860115 , @Szelethus wrote: > I dont think any of my comments were addressed -- could you follow up? I addressed two, added fixme for another one. Now I ex

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-05 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/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport &BR) -> std::string { + SmallString<256> Msg; ---

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 243571. baloghadamsoftware added a comment. Only track the right container. Furthermore, minor updates according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/li

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport &BR) -> std::string { + SmallString<256> Msg; ---

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 243796. baloghadamsoftware added a comment. First real checker `IteratorRange` now marks container as interesting to benefit from container note tags. The other two iterator checkers will be updated after a second phase of container note tags whic

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D73720#1871955 , @Szelethus wrote: > Do we have a test where 2 containers are present but only one of them should > be marked as interesting? Yes, of course we have, that was the starting point of the discussion. H

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-13 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 244380. baloghadamsoftware added a comment. In case of multiple container-related bugs only mark the container interesting on the correct bug path. Also a typo fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://revie

[PATCH] D74615: [Analyzer] Add visitor to track iterator invalidation

2020-02-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: steakhal, Charusso, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun. To understand the bug report issued by the `I

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-14 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 244667. baloghadamsoftware added a comment. Minor update: ignore parentheses and casts when taking the name of the expression. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/S

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

2020-02-14 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Superseded by [[ https://reviews.llvm.org/D73720 | [Analyzer] Use note tags to track container begin and and changes ]], [[ https://reviews.llvm.org/D74541 | [Analyzer] Use note tags to track iterator increments and

[PATCH] D74760: [Analyzer] Fix for iterator modeling and checkers: handle negative numbers correctly

2020-02-18 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: steakhal, Charusso, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, whisperity. Currently, using negative numbers in iterato

[PATCH] D74735: [analyzer] Add support for CXXInheritedCtorInitExpr.

2020-02-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D74735#1880390 , @xazax.hun wrote: > If the AST is hard to work with would it make sense to try to change the AST > a bit? Hmm, you mean making `CXXConstructExpr` an abstract base with subclasses `CXXSimpleConstru

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

2020-01-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238451. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/ https://reviews.llvm.org/D71001 Files: clang-tools-extra/clang-tidy/bugp

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-01-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238527. baloghadamsoftware retitled this revision from "[clang-tidy] New check cppcoreguidelines-prefer-initialization-list" to "[clang-tidy] New check cppcoreguidelines-prefer-initializer". baloghadamsoftware added a comment. Indentation of the c

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

2020-01-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238528. baloghadamsoftware added a comment. Indentation of the code fixed in the documentation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/ https://reviews.llvm.org/D71001 Files: clang-tools-extra/clang-tidy/bugprone/Bugpr

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

2020-01-20 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 5 inline comments as done. baloghadamsoftware added a comment. Hello, Thank you for your useful comments. I think I fixed them all now. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/ https://reviews.llvm.org/D71001

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

2020-01-20 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 239103. 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: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp

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

2020-01-21 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1830792 , @gribozavr2 wrote: > Let me know if you want me to commit this change for you. Thank you! I will commit it today. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/ https://reviews.

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

2020-01-21 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfccd0da5ee6f: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D71001?vs=239103&id=239290#toc R

[PATCH] D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'.

2020-01-21 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Hello, This checker is an alternative approach to our not yet published statistics-based checkers in a way: 2019 EuroLLVM Developers’ Meeting: A. Balogh “Statistics Based Checkers in the Clang Static Analyzer”

[PATCH] D73270: [clan-tidy] Fix false positive in bugprone-infinite-loop

2020-01-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added a reviewer: gribozavr2. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: mgehre, gamesh411, Szelethus, rnkovacs, whisperity. Herald added a project: clang. The checker `bugprone-infinite-loop` does n

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:186 +} + } + gribozavr2 wrote: > I think this logic should go into `isChanged()`, similarly

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 239927. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73270/new/ https://reviews.llvm.org/D73270 Files: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 240192. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73270/new/ https://reviews.llvm.org/D73270 Files: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 3 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:186 +} + } + gribozavr2 wrote: > baloghadamsoftware wrote: > > gribozavr2 wrote: > > > I th

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 240195. baloghadamsoftware added a comment. Minor fix. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73270/new/ https://reviews.llvm.org/D73270 Files: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp clang-tools-extra/test

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-27 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG70f4c6e7b14f: [clan-tidy] Fix false positive in bugprone-infinite-loop (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73270/

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-27 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Should I also commit it to the release 10.0 branch? This is a bugfix so it should be fixed in the release, I think. I added a dependency between this bug and the 10.0.0 release blockers. Is that enough? Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'.

2020-01-27 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Please consider the following test cases: void test_NullCorrectCheck3() { void *P = aligned_alloc(4, 8); use(*P); // A developer inserted this line before the check by mistake. This will be a null pointer dereference. if (P == NULL) { } }

[PATCH] D73547: [Analyzer] Split container modeling from iterator modeling

2020-01-28 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D73547#1845339 , @NoQ wrote: > This patch is simply moving code around, right? If so, why did tests need to > be removed? All of the container begin- and end-tests were removed from `iterator-modeling.cpp` and mov

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

2020-01-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 241364. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70818/new/ https://reviews.llvm.org/D70818 Files: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td clang/lib/StaticAnalyzer/Che

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-01-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, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun. Container operations such as `push_back()`, `po

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-03-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Escaping exception is certainly a bug, so it should go into `bugprone` then. https://reviews.llvm.org/D33537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-03-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 139583. baloghadamsoftware added a comment. Moved to bugprone. https://reviews.llvm.org/D33537 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/ExceptionEscapeCheck.cpp clang-tidy/bu

[PATCH] D41938: [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and Analyzer Option)

2018-03-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 140061. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Comment fixed. https://reviews.llvm.org/D41938 Files: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h lib/StaticAnalyzer/Core/AnalyzerOptions

[PATCH] D41938: [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and Analyzer Option)

2018-03-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h:675-677 + /// is on the right. This is only done if both concrete integers are greater + /// than or equal to the quart

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-03-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 140079. baloghadamsoftware added a comment. Updated according to the comments. https://reviews.llvm.org/D33537 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/ExceptionEscapeCheck.cpp

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-03-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tidy/bugprone/ExceptionEscapeCheck.cpp:24-25 + +const TypeVec _throws(const FunctionDecl *Func); +const TypeVec _throws(const Stmt *St, const TypeVec &Caught); +} // n

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-03-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 140117. baloghadamsoftware added a comment. ,html removed from release notes. https://reviews.llvm.org/D33537 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/ExceptionEscapeCheck.cpp

[PATCH] D41938: [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and Analyzer Option)

2018-04-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. George or Devin, please accept it or give me some feedback if not. Since this patch affects the core infrastructure I think it is wise to merge it only if at least two of you have accepted it. Artem is one,

[PATCH] D41938: [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and Analyzer Option)

2018-04-10 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL329780: [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and Analyzer… (authored by baloghadamsoftware, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2018-04-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 141955. baloghadamsoftware added a comment. Herald added a reviewer: george.karpenkov. Rebased to the newly committed SValbuilder rearranger patch https://reviews.llvm.org/D35110 Files: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp test/

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-04-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for your thorough review, I will do the fixes next week, after the Euro LLVM. https://reviews.llvm.org/D33537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailma

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120408. baloghadamsoftware added a comment. Updated according to comments. https://reviews.llvm.org/D39121 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/MisplacedOperatorInStrlenInA

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120545. baloghadamsoftware added a comment. Updated according to the comments. https://reviews.llvm.org/D39121 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/MisplacedOperatorInStrle

[PATCH] D39366: [ASTMatchers] Matchers for new[] operators

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: rnkovacs. Two new matchers for ``CXXNewExpr`` are added which may be useful e.g. in clang-tidy checkers. One of them is ``isArrayForm`` which matches ``new[]`` but not plain ``new`. The other one, ``hasArraySize`` matches ``new

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: rnkovacs. The check now recognizes error cases like `new char[strlen(s + 1)]` and suggests a fix in the format `new char[strlen(s) + 1]`. https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenI

[PATCH] D39366: [ASTMatchers] Matchers for new[] operators

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120577. baloghadamsoftware added a comment. Matcher renamed to `isArray`. https://reviews.llvm.org/D39366 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/ASTM

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120579. baloghadamsoftware added a comment. Reformatted according to the comments. https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp docs/ReleaseNotes.rst docs/clang-tidy/checks/bugprone-mi

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. In https://reviews.llvm.org/D39367#909117, @JonasToth wrote: > Should the release notes be modified as well? I think so. I consider the inclusion of operator `new[]` important. https://reviews.llvm.org/D3

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39121#909172, @aaron.ballman wrote: > Many of the comments are marked done, but the code does not reflect that it > actually is done, so I'm not certain what's happened there. Neither do I. I will try to re-upload the diff. htt

[PATCH] D39370: [clang-tidy] Detect bugs in bugprone-misplaced-operator-in-strlen-in-alloc even in the case the allocation function is called using a constant function pointer

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Detect bugs even if a function of the `malloc()` family is called using a constant pointer. https://reviews.llvm.org/D39370 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp docs/clang-tidy/checks/bugprone-misplaced-operator-in-s

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120582. baloghadamsoftware added a comment. Second try to upload the correct diff... https://reviews.llvm.org/D39121 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/MisplacedOperatorI

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120593. baloghadamsoftware added a comment. Docs rephrased according to the comments. https://reviews.llvm.org/D39121 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/MisplacedOperator

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120595. baloghadamsoftware added a comment. Herald added a subscriber: mgorny. Backsticks changed to single quotes, new tests added. https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLi

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120776. baloghadamsoftware added a comment. Oops! Sorry! https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h docs/ReleaseNotes.rst

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39121#909255, @aaron.ballman wrote: > My only remaining concern is with the diagnostic message/fixit interaction > itself. Let's see if @alexfh has any suggestions there, or we think of an > improvement ourselves. What do you me

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39121#910715, @aaron.ballman wrote: > The diagnostic tells the user that you surround the arg to strlen with parens > to silence the diagnostic, but the fixit doesn't do that -- it moves the > addition to the result. That's confus

[PATCH] D39370: [clang-tidy] Detect bugs in bugprone-misplaced-operator-in-strlen-in-alloc even in the case the allocation function is called using a constant function pointer

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39370#910791, @aaron.ballman wrote: > LGTM > > FYI: it's been difficult to perform this review because all of these reviews > are touching the same chunk of code for something that's not been committed > yet. It would be easier to

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I thought on something like this, but I still do not like my phrasing: "Addition operator is applied to the argument of strlen(). instead of its result; move the '+ 1' outside of the call. (Or, if it is intentional then surround the addition subexpression wit

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2017-10-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. It seems that review on https://reviews.llvm.org/D35109 is stuck forever. So maybe we should forget about this simplification and return to the local solution I tried to use here originally. It is Part2, and we need to go through all parts as soon as possible

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-10-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:595 + + if (origWidth < 128) { +auto newWidth = std::max(2 * origWidth, (uint32_t) 8); danielmarjamaki wrote: > I would like that "128" is rew

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-10-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Any progress reviewing this? Iterator checkers are pending for more than half a year because of this. An alternative solution is to always extend the type and change `ProgramState::assumeInbound()` so it does not move everything to the bottom of the range, b

[PATCH] D22374: [analyzer] Copy and move constructors - ExprEngine extended for "almost trivial" copy and move constructors

2017-10-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120954. baloghadamsoftware added a comment. Herald added subscribers: szepet, whisperity. Tests updated. https://reviews.llvm.org/D22374 Files: lib/StaticAnalyzer/Core/ExprEngineCXX.cpp test/Analysis/ctor.mm Index: test/Analysis/ctor.mm

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Can you give me please an example where `malloc(strlen(s+1))` is intentional. It allocates `2` byte less than needed to store `s`. If it is really the goal (e.g. `s` has a `2` character prefix which we do not want to copy) then the correct solution is to use

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-31 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39121#911741, @aaron.ballman wrote: > As I pointed out earlier in the thread, it is common to have > double-null-terminated strings in Win32 APIs. This is a case where strlen(s + > N) is valid. Since 1-byte strings would also be a

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-11-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 121102. baloghadamsoftware added a comment. Diagnostic message changed. https://reviews.llvm.org/D39121 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/MisplacedOperatorInStrlenInAllo

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-11-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. OK, I will test it on some real code tomorrow, but today is a holiday here. https://reviews.llvm.org/D39121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-11-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I tested it on a C project (Postgres) and found no false positives. https://reviews.llvm.org/D39121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-11-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39121#914875, @Abpostelnicu wrote: > I can test this on our repo, Mozilla, since it's a large code-base I think we > you will have a better understanding of the false-positive ratio. Thank you in advance! https://reviews.llvm.o

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-11-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for you work! Probably I did some mistake because my MAX/4solution did not work when I it earlier. Your solution seems to work. For the iterator checkers this is surely enough. Should I upload my patch patched with your one? https://reviews.llvm.or

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-11-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39121#915123, @aaron.ballman wrote: > Out of curiosity, were there any true positives, either? No, in a release version there should be no true positives of this kind, I think. https://reviews.llvm.org/D39121 ___

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-11-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 121690. baloghadamsoftware added a comment. Updated according to the comments. https://reviews.llvm.org/D39121 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/MisplacedOperatorInStrle

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-11-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 121691. baloghadamsoftware added a comment. Updated to match https://reviews.llvm.org/D39121. https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp docs/ReleaseNotes.rst docs/clang-tidy/checks/

[PATCH] D39370: [clang-tidy] Detect bugs in bugprone-misplaced-operator-in-strlen-in-alloc even in the case the allocation function is called using a constant function pointer

2017-11-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 121692. baloghadamsoftware added a comment. Updated to match https://reviews.llvm.org/D39121. https://reviews.llvm.org/D39370 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp docs/clang-tidy/checks/bugprone-misplaced-opera

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-11-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for your comment! Unfortunately, the iterator checkers depend very much on the >/>=/=C.end(), I cannot imagine this to be solved just with ==/!=. How to find the N if we only use == or !=? Furthermore, later parts also add invalidation check where w

[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

2017-11-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D35109#916648, @NoQ wrote: > > How to find the N if we only use == or !=? > > Hence the difference between `==` and `is-the-same-symbol-as`. We can find > `N` by looking at the symbol. Sorry, if I misunderstand something, but if I

<    4   5   6   7   8   9   10   >