[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D85424#2203329 , @NoQ wrote: > Tests? (edit: ok, i see, you have trouble reducing the test. yes, we > absolutely need a test, please finish with creduce/delta.) I will not commit it without tests, even if someone ac

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Unfortunately, I could not create test for it. It is extremely rare that the //Analyzer// creates an `UndefinedVal`. I had the following output: 1. parser at end of file 2.While analyzing stack: #0 Calling llvm::object::BindRebaseSegInfo::

[PATCH] D85424: [Analyzer] Crash fix for alpha.cplusplus.IteratorRange

2020-08-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus, gamesh411. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, martong, steakhal, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whi

[PATCH] D85351: [Analyzer] Fix for `ExprEngine::computeObjectUnderConstruction()` for base and delegating consturctor initializers

2020-08-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, vsavchenko. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, martong, steakhal, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity. H

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-08-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 282914. baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added a comment. Minor fix. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76590/new/ https://reviews.llvm.org/D76590 Files: clang/lib/StaticAnalyzer/Checke

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-08-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 282909. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76590/new/ https://reviews.llvm.org/D76590 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp cl

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-08-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:56 +SVal RetVal) const; + void handleErase(CheckerContext &C, const Expr *CE, SVal Cont, SVal It

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-08-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 282876. baloghadamsoftware added a comment. `else` branch merged with inner `if`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77229/new/ https://reviews.llvm.org/D77229 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D76604: [Analyzer] Model `size()` member function of containers

2020-08-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 282675. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76604/new/ https://reviews.llvm.org/D76604 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp clang/lib/StaticAnalyzer/Che

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

2020-08-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 282642. baloghadamsoftware added a comment. Option made hidden. However, I think we should create a category "advanced" for options which affect the internal modeling. Our users are programmers and the advanced among them should see this option (a

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-08-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D83190#2164361 , @gamesh411 wrote: > I experienced 2 crashes with and without this patch using commit > `1af9fc82132da7c876e8f70c4e986cc9c59010ee` on master: > I have used the clang built on that revision to analyse

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-08-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 282626. baloghadamsoftware added a comment. Crash Fix: do not retrieve first iterator argument in advance. (It may happen that although argument count is more than zero, there is no argument at all.) CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-07-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 278832. baloghadamsoftware added a comment. Rebased, updated. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76590/new/ https://reviews.llvm.org/D76590 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp clang/lib/StaticAna

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-17 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. Looks good, aside from the few naming issues I mentioned. Please try it on //LLVM/Clang// before committing it to avoid unexpected crashes. Comment a

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

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 278574. baloghadamsoftware added a comment. Rebased, no tricks with `LazyCompoundVal`s are used anymore. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75677/new/ https://reviews.llvm.org/D75677 Files: clang/lib/StaticAnalyzer/Checkers/

[PATCH] D74541: [Analyzer] Use note tags to track iterator increments and decrements

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/test/Analysis/iterator-modelling.cpp:434 + //expected-note@-1 0-1{{Calling 'next}} + //expected-note@-2 0-1{{Passing the value 1 via 2nd parameter 'n'}} + //expecte

[PATCH] D83295: [Analyzer] Hotfix for various crashes in iterator checkers

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa59d4ae4313c: [Analyzer] Hotfix for various crashes in iterator checkers (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D8329

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Now I made some measurements about the false positives this option adds. For `BitCoin` the increase was `-1`. I do not know how it happened, but it reduced the number of false positives by one. For `LLVM/Clang` the increase was `15` which is less than `4%` be

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

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

[PATCH] D77125: [Analyzer] Model return values of container insert and delete operations

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 278395. baloghadamsoftware added a comment. Protection agains `Unknown` return values added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77125/new/ https://reviews.llvm.org/D77125 Files: clang/lib/StaticAnalyzer/Checkers/ContainerMod

[PATCH] D83295: [Analyzer] Hotfix for various crashes in iterator checkers

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 278394. baloghadamsoftware added a comment. Protection against `Unknown` added for pointer increments and decrements. No more crashes on `LLVM/Clang`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83295/new/ https://reviews.llvm.org/D832

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

2020-07-14 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I am trying to measure the amount of extra false positive on real code (not artificial examples) of this option. The modeling of container size may reduce it, of course, but we have no other option to find this bug: even loop-unrolling or loop-widening is not

[PATCH] D83295: [Analyzer] Hotfix for various crashes in iterator checkers

2020-07-13 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 277340. baloghadamsoftware edited the summary of this revision. baloghadamsoftware added a comment. Two more crashes detected, fixes for them added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83295/new/ https://reviews.llvm.org/D83295

[PATCH] D83295: [Analyzer] Hotfix for various crashes in iterator checkers

2020-07-09 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:275-276 } else if (isRandomIncrOrDecrOperator(OK)) { +if (!BO->getRHS()->getType()->isIntegralOrEnumerationType

[PATCH] D83295: [Analyzer] Hotfix for various crashes in iterator checkers

2020-07-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 276684. baloghadamsoftware edited the summary of this revision. baloghadamsoftware added a comment. Test added for the third fix in this patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83295/new/ https://reviews.llvm.org/D83295 File

[PATCH] D83295: [Analyzer] Hotfix for various crashes in iterator checkers

2020-07-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, gamesh411, martong, balazske. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, steakhal, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xaza

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Nice work, but please implement this feature also for non-pointer iterators for the matter of consistence. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:279 +// or on the RHS (eg.: 1 + it). Both cases are modeled. +

[PATCH] D82585: [analyzer][NFC] Move the data structures from CheckerRegistry to the Core library

2020-07-03 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. It looks OK. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82585/new/ https://reviews.llvm.org/D82585 ___ cfe-co

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

2020-07-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 275406. baloghadamsoftware added a comment. Rebased. Tests added. Fixed to work on `std::vector`-like and `std::deque`-like containers as well. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77150/new/ https://reviews.llvm.org/D77150 Fil

[PATCH] D77125: [Analyzer] Model return values of container insert and delete operations

2020-07-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 275405. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77125/new/ https://reviews.llvm.org/D77125 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp clang/test/Analysis/Inputs/s

[PATCH] D82585: [analyzer][NFC] Move the data structures from CheckerRegistry to the Core library

2020-07-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/CheckerRegistryData.h:216 + /// This output is not intended to be machine-parseable. + void printCheckerWithDescList(const AnalyzerOptions &AnOpts, raw_ostream &Out, +

[PATCH] D83115: [Analyzer] Report every bug if only uniqueing location differs.

2020-07-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/Analysis/PathDiagnostic.cpp:333 + if (XL.isValid() && YL.isInvalid()) +return false; std::pair XOffs = XL.getDecomposedLoc(); Why this asymmetry? Comment at: clang/lib/Anal

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

2020-07-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. In D71199#2125602 , @njames93 wrote: > Just my 2 cents, but would it not be wise to introduce a test case that runs > the 2 aforementioned checks together demonstrati

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

2020-07-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:647-653 CmdLineOption ]>, Szelethus wrote: > Szelethus wrote: > > NoQ wrote: > > > baloghada

[PATCH] D82185: [Analyzer] Handle pointer implemented as iterators in iterator checkers

2020-07-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D82185#2124948 , @thakis wrote: > This (or a follow-up) broke tests on windows: > http://45.33.8.238/win/18877/step_7.txt > > Please take a look and revert for now if it takes a while to fix. It was this one: D8238

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-07-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 274742. baloghadamsoftware added a comment. Rebased on `master` which now contains the handling of pointers as iterators. All tests passed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77229/new/ https://reviews.llvm.org/D77229 Files:

[PATCH] D82185: [Analyzer] Handle pointer implemented as iterators in iterator checkers

2020-07-01 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9e63b190af76: [Analyzer] Handle pointer implemented as iterators in iterator checkers (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D82185?vs=272973&id=274700#toc

[PATCH] D82385: [Analyzer] Fix errors in iterator modeling

2020-07-01 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGea563daae523: [Analyzer] Fix errors in iterator modeling (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82385/new/ https://

[PATCH] D82563: [Sema][NFC] Remove Redundant Condition

2020-07-01 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG40c50bdee443: [Sema][NFC] Remove Redundant Condition (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82563/new/ https://revi

[PATCH] D81396: [clang-tidy] New util `Aliasing` factored out from `bugprone-infinite-loop`

2020-07-01 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4da65c2920b6: [clang-tidy] New util `Aliasing` factored out from `bugprone-infinite-loop` (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revie

[PATCH] D82845: [Analyzer][StreamChecker] Report every leak, clean up state.

2020-06-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D82845#2122984 , @balazske wrote: > I checked it with simple debug print, the `LeakedSyms` will contain 2 items > with different `StreamOpenNode`. So I think these should be independent > problem reports for the bug

[PATCH] D79431: [analyzer] StdLibraryFunctionsChecker: Add better diagnostics

2020-06-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D79431#2020951 , @Szelethus wrote: > Sure, this is an improvement because we display more information, but I'd > argue that it isn't really a more readable warning message :) How about > > th argument to the call to

[PATCH] D79431: [analyzer] StdLibraryFunctionsChecker: Add better diagnostics

2020-06-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:323 +std::string("Function argument constraint is not satisfied, ") + +VC->getName().data() + ", ArgN: " + std::to_string(VC->getArgNo()); i

[PATCH] D81761: [analyzer] Force dependency checkers to be hidden

2020-06-30 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. Now it looks good to me. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81761/new/ https://reviews.llvm.org/D81761 __

[PATCH] D81272: [clang-tidy] New check `misc-redundant-condition`

2020-06-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. True positive confirmed in //PostGreS//: Mailing List Archive . It is fixed by now, so you cannot see it on the link in my previous comment anymore.

[PATCH] D81761: [analyzer] Force dependency checkers to be hidden

2020-06-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D81761#2097737 , @Szelethus wrote: > In D81761#2097561 , @balazske wrote: > > > My observation is, if there is an example checker, it should be really > > "example" and not "t

[PATCH] D71155: [analyzer] CERT STR rule checkers: STR30-C

2020-06-29 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. Herald added a subscriber: rnkovacs. Comment at: clang/docs/analyzer/checkers.rst:1973 +``strpbrk()``, ``strchr()``, ``strrchr()``, ``st

[PATCH] D71033: [analyzer] CERT STR rule checkers: STR32-C

2020-06-29 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. Herald added a subscriber: rnkovacs. Comment at: clang/docs/analyzer/checkers.rst:1982 +It warns on reading non-null-terminated strings.

[PATCH] D70411: [analyzer] CERT STR rule checkers: STR31-C

2020-06-29 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. Herald added a subscriber: rnkovacs. Comment at: clang/lib/StaticAnalyzer/Checkers/cert/StrChecker.cpp:55 + // they can cause a not nul

[PATCH] D70411: [analyzer] CERT STR rule checkers: STR31-C

2020-06-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:859 + +def Str31cChecker : Checker<"31c">, + HelpText<"SEI CERT checker of rules defined in STR31-C">, Maybe we could have more descriptive names for th

[PATCH] D70411: [analyzer] CERT STR rule checkers: STR31-C

2020-06-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt:21 CastValueChecker.cpp + cert/StrChecker.cpp CheckObjCDealloc.cpp Are there so many things common among checkers for SEI CERT string rules that the bes

[PATCH] D82563: [Sema][NFC] Remove Redundant Condition

2020-06-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: sammccall, rsmith. baloghadamsoftware added a project: clang. Herald added subscribers: martong, gamesh411, Szelethus, dkrupp, rnkovacs. Condition `TypeQuals` is checked both in an outer and in an inner `if` statement i

[PATCH] D81272: [clang-tidy] New check `misc-redundant-condition`

2020-06-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I tested this check on several open-source projects: //BitCoin//, //CURL//, //OpenSSL//, //PostGreS/, //TMux/ and //Xerces//. I only got two warnings issued by this checker, the first one in //BitCoin//: src/checkqueue.h:93:25: redundant condition 'fMaster'

[PATCH] D82385: [Analyzer] Fix errors in iterator modeling

2020-06-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:530-532 const auto *Pos = getIteratorPosition(State, LHS); if (!Pos) return; Szelethus wro

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

2020-06-24 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/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer-assignment.cpp:29 +public: + Simple2() : n (0) { +x = 0.0; aaro

[PATCH] D82185: [Analyzer] Handle pointer implemented as iterators in iterator checkers

2020-06-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 272973. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82185/new/ https://reviews.llvm.org/D82185 Files: clang/lib/StaticAnalyzer/Checkers/InvalidatedIteratorChecker

[PATCH] D82385: [Analyzer] Fix errors in iterator modeling

2020-06-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 272950. baloghadamsoftware edited the summary of this revision. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82385/new/ https://reviews.llvm.org/D82385 Files: clan

[PATCH] D82385: [Analyzer] Fix errors in iterator modeling

2020-06-24 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 272927. baloghadamsoftware added a comment. Code reformatted according to Lint Pre-Merge check suggestions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82385/new/ https://reviews.llvm.org/D82385 Files: clang/lib/StaticAnalyzer/Checke

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-06-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 272735. baloghadamsoftware added a comment. No new functions in `CallEvent` needed, instead new functions in the iterator library. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77229/new/ https://reviews.llvm.org/D77229 Files: clang/l

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. The new functions are now considered as iterator-specific thus moved into D77229 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81718/new/ https://reviews.llvm.org/D81718

[PATCH] D82385: [Analyzer] Fix errors in iterator modeling

2020-06-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus, gamesh411, martong, balazske. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, steakhal, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xaz

[PATCH] D82185: [Analyzer] Handle pointer implemented as iterators in iterator checkers

2020-06-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 272469. baloghadamsoftware retitled this revision from "[Analyzer][WIP] Handle pointer implemented as iterators in iterator checkers" to "[Analyzer] Handle pointer implemented as iterators in iterator checkers". baloghadamsoftware edited the summar

[PATCH] D82185: [Analyzer][WIP] Handle pointer implemented as iterators in iterator checkers

2020-06-21 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:256 + SVal SubVal = State->getSVal(UO->getSubExpr(), C.getLocationContext()); + SVal Result = State->getSVal(UO, C.g

[PATCH] D82185: [Analyzer][WIP] Handle pointer implemented as iterators in iterator checkers

2020-06-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:256 + SVal SubVal = State->getSVal(UO->getSubExpr(), C.getLocationContext()); + SVal Result = State->getSVal(UO, C.g

[PATCH] D82185: [Analyzer][WIP] Handle pointer implemented as iterators in iterator checkers

2020-06-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:256 + SVal SubVal = State->getSVal(UO->getSubExpr(), C.getLocationContext()); + SVal Result = State->getSVal(UO, C.g

[PATCH] D82185: [Analyzer][WIP] Handle pointer implemented as iterators in iterator checkers

2020-06-19 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus, martong, gamesh411. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, steakhal, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whi

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I am really sorry to tell that, but now I began adding support for raw pointers as iterators (I will upload them in a separate patch when fully ready) and then tried your test. It passes, the error is found using this particular patch. So please tell me what

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. > It tests exactly what i want: the correctness of your code in //this very > patch// that was written to handle //this very case// for which you never > even bothered figuring out the correct solution but you already wrote //a > large amount of code// (inclu

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D81718#2096540 , @NoQ wrote: > In D81718#2095965 , > @baloghadamsoftware wrote: > > > Your test case unfortunately does not test what you want, because raw > > pointers are n

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D81718#2095957 , @NoQ wrote: > If the checker does not know something, then neither does a method on > `CallEvent`. I suggest you don't introduce methods on `CallEvent` the entire > purpose of which is to support an

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Your test case unfortunately does not test what you want, because raw pointers are not supported yet: all the checkers look for overloaded operators of classes, basic operator expressions are not handled yet. It is planned, of course, in the future, once we c

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D81718#2095043 , @NoQ wrote: > So it still thinks that the iterator is an object, whereas it should be > tracking the iterator as symbol instead. As expected, because your code fails > to discriminate between these

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-15 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 270814. baloghadamsoftware added a comment. Updated to check the type of the argument expression instead of the `SVal`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81718/new/ https://reviews.llvm.org/D81718 Files: clang/include/clang

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for taking a look on this! Let me explain! An iterator may be implemented by multiple ways. It can be a simple pointer, which means that it is a basic type passed by value both as argument and return value. Thus here `getArgSVal()` and `getReturnVal

[PATCH] D80699: [Analyzer][StreamChecker] Add check for pointer escape.

2020-06-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:439-441 + // Do not handle untracked stream. It is probably escaped. + if (!State->get(StreamSym)) +return; balazske wrote: > Szelethus wrote: > > How

[PATCH] D77229: [Analyzer] Avoid handling of LazyCompundVals in IteratorModeling

2020-06-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 270335. baloghadamsoftware retitled this revision from "[Analyzer][WIP] Avoid handling of LazyCompundVals in IteratorModeling" to "[Analyzer] Avoid handling of LazyCompundVals in IteratorModeling". baloghadamsoftware edited the summary of this revi

[PATCH] D81718: [Analyzer][NFC] Add methods `getReturnObject()` and `getArgObject()` to `CallEvent`

2020-06-12 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added a reviewer: NoQ. baloghadamsoftware added a project: clang. Herald added subscribers: ASDenysPetrov, martong, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, w

[PATCH] D81396: [clang-tidy] New util `Aliasing` factored out from `bugprone-infinite-loop`

2020-06-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 269779. baloghadamsoftware added a comment. Parameters in comments changed to `\p `. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81396/new/ https://reviews.llvm.org/D81396 Files: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopChec

[PATCH] D81272: [clang-tidy] New check `misc-redundant-condition`

2020-06-10 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 269769. baloghadamsoftware added a comment. Thank you for your help, @njames93! I updated the patch according to your comments. (And of course, also thank you, @Eugene.Zelenko, I also incorporated the changes you suggested.) CHANGES SINCE LAST A

[PATCH] D80286: [Analyzer] Allow creation of stack frame for functions without definition

2020-06-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D80286#2083753 , @saugustine wrote: > Unfortunately, after this change there are several variables only used in > asserts, which creates build failures when assertions are disabled. > > I will be submitting https://r

[PATCH] D81396: [clang-tidy] New util `Aliasing` factored out from `bugprone-infinite-loop`

2020-06-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 269533. baloghadamsoftware added a comment. Thank you for the comment, @gribozavr2! Patch updated according to them. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81396/new/ https://reviews.llvm.org/D81396 Files: clang-tools-extra/clan

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions

2020-06-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D80522#2082095 , @teemperor wrote: > This introduced a compiler warning: > > > /Users/teemperor/1llvm/llvm-project/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:1102:23: > warning: 'getDecl' ov

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D80366#2082100 , @thakis wrote: > Hello, this breaks check-clang everywhere, e.g. > http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/69062/steps/test-check-all/logs/FAIL%3A%20Clang-

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-09 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 rG813734dad7e8: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent` (authored by baloghadamsoftware). Changed prior to commit: https://r

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions

2020-06-09 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG98db1f990fc2: [Analyzer] [NFC] Parameter Regions (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D80522?vs=268131&id=269477#toc Repository: rG LLVM Github Monorepo

[PATCH] D80286: [Analyzer] Allow creation of stack frame for functions without definition

2020-06-09 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5419a3121522: [Analyzer] Allow creation of stack frame for functions without definition (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D80286?vs=266036&id=269478#toc

[PATCH] D81272: [clang-tidy] New check `misc-redundant-condition`

2020-06-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 11 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/RedundantConditionCheck.cpp:39 + declRefExpr(hasDeclaration(varDecl().bind("cond_var"))), + binaryOperator

[PATCH] D81272: [clang-tidy] New check `misc-redundant-condition`

2020-06-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 269222. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81272/new/ https://reviews.llvm.org/D81272 Files: clang-tools-extra/clang-tidy/misc/CMakeLists.txt clang-too

[PATCH] D81396: [clang-tidy] New util `Aliasing` factored out from `bugprone-infinite-loop`

2020-06-08 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: aaron.ballman, gribozavr2, JonasToth, alexfh, hokein. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: martong, steakhal, gamesh411, Szelethus, dkrupp, rnkovacs, xazax.hun, whisperity, mg

[PATCH] D81272: [Clang-Tidy] New check `misc-redundant-condition`

2020-06-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. This check was made upon user request. I think it is a good base that can later be extended also for the negated cases (where the code inside the inner `if` never executes). That case is even more suspicious

[PATCH] D81272: [Clang-Tidy] New check `misc-redundant-condition`

2020-06-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: aaron.ballman, gribozavr2. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: martong, steakhal, gamesh411, Szelethus, dkrupp, rnkovacs, xazax.hun, whisperity, mgorny. Herald added a project

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-03 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/Core/CallEvent.cpp:543 + + const StackFrameContext *StackFrame = Call.getCalleeStackFrame(BlockCount); + if (!StackFrame) NoQ wro

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 268176. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80366/new/ https://reviews.llvm.org/D80366 Files: clang/i

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions

2020-06-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:921 +public: + const VarDecl *getDecl() const override = 0; + NoQ wrote: > What's the po

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions

2020-06-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 268131. baloghadamsoftware added a comment. Comment fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80522/new/ https://reviews.llvm.org/D80522 Files: clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h clang/include/clan

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 9 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CallEvent.cpp:552 + + Index = StackFrame->getIndex(); + vsavchenko wrote: > Szelethus wrote: > > baloghadamsoftware wrote: >

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 268082. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80366/new/ https://reviews.llvm.org/D80366 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEv

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 267879. baloghadamsoftware added a comment. Incorporated @NoQ's solution. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80366/new/ https://reviews.llvm.org/D80366 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h

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

2020-06-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer-assignment.cpp:29 +public: + Simple2() : n (0) { +x = 0.0; aaro

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

2020-06-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 267833. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.tx

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