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

2020-04-04 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: > Ah, okay, I see which one you refer to. We shou

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

2020-04-06 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 255279. baloghadamsoftware added a comment. More progress... CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77229/new/ https://reviews.llvm.org/D77229 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h clang/incl

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

2020-04-06 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/Core/ExprEngineCXX.cpp:127 + const auto *Init = ICC->getCXXCtorInitializer(); + return getObjectUnderConstruction(State, Init, LCtx); +

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

2020-04-06 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D77229#1963485 , @NoQ wrote: > Uh-oh, it's annoying indeed that you can't easily obtain the current CFG > element from inside a `CallEvent`. > > Given that every `CallEvent` is in fact associated with a `CFGElement`

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

2020-04-06 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Another problem: parameters can also be `LazyCompoundVal`s, but `CallEvent::getParameterLocation()` does not handle non-inlined calls. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77229/new/ https://reviews.llvm.org/D77229 ___

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

2020-04-07 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 255641. baloghadamsoftware added a comment. Experimenting... CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77229/new/ https://reviews.llvm.org/D77229 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h clang/incl

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

2020-04-07 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Any idea for `LazyCompoundVal` parameters of functions not inlined? Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:231-235 +if (dyn_cast_or_null(LCtx->getParentMap().ge

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

2020-04-07 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D77229#1966711 , @baloghadamsoftware wrote: > Any idea for `LazyCompoundVal` parameters of functions not inlined? OK, I can reach them from the `ConstructionContext` of the arguments. However, they are temporaries

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

2020-04-07 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D77229#1966885 , @baloghadamsoftware wrote: > OK, I can reach them from the `ConstructionContext` of the arguments. > However, they are temporaries and for some strange reason not alive which > means that `checkDea

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

2020-04-07 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. In D77229#1967269 , @NoQ wrote: > In D77229#1966888 , > @baloghadamsoftware wrote: > > > Not so strange, of course, they are

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

2020-04-07 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:541-542 +BR.markInteresting(It1); +if (const auto &LCV1 = It1.getAs()) { + BR.markInteresting

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

2020-04-08 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 255922. baloghadamsoftware added a comment. Next attempt. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77229/new/ https://reviews.llvm.org/D77229 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h clang/include

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

2020-04-08 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/Core/ExprEngineCXX.cpp:231-235 +if (dyn_cast_or_null(LCtx->getParentMap().getParent(E))) { + MemRegionManager &MRMgr = getSValBuil

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

2020-04-08 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:541-542 +BR.markInteresting(It1); +if (const auto &LCV1 = It1.getAs()) { + BR.markInteresting

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

2020-04-08 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Another showstopper: the test `container_modeling.cpp` passed with analyzer option `container-inlining=false`. However it faild with `container-inlining=true -DINLINE=1`. The problem is that the `CFGElement` for function `iterator begin() { return iterator(_s

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

2020-04-08 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. In D77229#1969524 , @NoQ wrote: > In D77229#1969455 , > @baloghadamsoftware wrote: > > > The problem is that the `CFGElement`

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

2020-04-08 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D77229#1969524 , @NoQ wrote: > In D77229#1969455 , > @baloghadamsoftware wrote: > > > The problem is that the `CFGElement` for function `iterator begin() { > > return iterato

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

2020-04-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 256310. baloghadamsoftware added a comment. OK. I solved almost every problem except that `checkDeadSymbols()` removes the iterator position keyed by the temporary region representing the argument from the map before it is needed. Either I must so

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

2020-04-14 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. OK, I made some experiments. In function `vector_insert_begin()` of test file `iterator-modeling.cpp`, line `960` we pass `i0` to `std::vector::insert()`. This function has no body at all so regardless of inlining of STL functions is enabled, this function is

[PATCH] D77802: [analyzer] Improved RangeSet::Negate support of unsigned ranges

2020-04-14 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for fixing this issue! Please add a bit more tests where we can see that the negated of unsigned range of `[n..m]` is `UINT_MAX-m+1..UINT_MAX-n+1]`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77802/

[PATCH] D78101: [analyzer][StackAddressEscape] Tie warnings to the diagnostic checkers rather then core.StackAddrEscapeBase

2020-04-14 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. This seems to be an obvious fix. Thank you for working on this! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78101/new/

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

2020-04-15 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D77229#1980665 , @NoQ wrote: > Aha, ok, sounds like i thought that it's not worth it to inline the > constructor for an argument when the call itself is not inlined, therefore i > didn't model the construction conte

[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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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-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-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#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. 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. > 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-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] 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] 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] 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] 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] 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] 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] 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] 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] 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-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-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] 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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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 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] 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] 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] 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] 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] 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] 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] 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] D77802: [analyzer] Improved RangeSet::Negate support of unsigned ranges

2020-04-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. The unit test you added is very welcome. However, please still extend the current tests (which are for the signed) also for the unsigned as well. Since this is a core change in the analyzer, let us wait for @NoQ as well before accepting it. CHANGES SINCE LA

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

2020-04-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 258798. baloghadamsoftware added a comment. I commented out lines which prevent creation of `StackFrameContext` for non-inlined functions. Now everything works regarding the iterator checkers. I also simplified things and created new methods for `

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

2020-04-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 259060. baloghadamsoftware added a comment. My first attempt for a new special kind of region for parameters of functions without definitions. Currently it causes more failed tests and assertions than ignoring the problem of different `Decl`s. I w

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

2020-04-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 259272. baloghadamsoftware added a comment. First version that seems to be working :-) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77229/new/ https://reviews.llvm.org/D77229 Files: clang/include/clang/StaticAnalyzer/Checkers/SValExpl

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

2020-04-22 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 7 inline comments as done. baloghadamsoftware added a comment. Thank you for your comments. Of course I plan to upload all these changes in at least three different patches. But first I needed a version that is working. However if I split this up I will have to write lo

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

2020-04-23 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:1044 +class ParamWithoutVarRegion : public TypedValueRegion { + friend class MemRegionManager;

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

2020-04-23 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/Core/PathSensitive/MemRegion.h:1044 +class ParamWithoutVarRegion : public TypedValueRegion { + friend class MemRegionManager;

[PATCH] D78289: [analyzer] Stability improvements for IteratorModeling functions

2020-04-23 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. Thanks for fixing this! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78289/new/ https://reviews.llvm.org/D78289 ___

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