[PATCH] D99658: [analyzer] Fix clang_analyzer_getExtent for heap regions

2021-04-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal abandoned this revision. steakhal added a comment. In D99658#2671747 , @NoQ wrote: > I mean, the extent of an `ElementRegion` //is// the size of a single element. > The reason why our intrinsic isn't doing what you expect is because we > represe

[PATCH] D99262: [analyzer] Fix dead store checker false positive

2021-04-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. Looks good. Thank you. Comment at: clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp:420-421 + // We should also allow defensive initialization of structs. + if (const auto *ILE = +

[PATCH] D99260: [analyzer] Fix false positives in inner pointer checker (PR49628)

2021-04-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I'm still not satisfied with the `addressof`, but I won't block this either. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99260/new/ https://reviews.llvm.org/D99260 ___ cfe-com

[PATCH] D85528: [analyzer] Fix cast evaluation on scoped enums in ExprEngine

2021-04-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I really want to move this forward so I made a further evaluation on this, on the MongoDB project. The analysis took approx. 22 and half hours on 24 cores for the baseline and for this revision as well. There were 7116 common reports, 5 disappeared and new 34 were intr

[PATCH] D97183: [analyzer] Add NoteTag for smart-ptr get()

2021-04-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D97183#2699080 , @RedDocMD wrote: > For the following function: > > void foo(std::unique_ptr P) { > A* praw = P.get(); > A* other = praw; > if (other) {} > P->foo(); > } > > Where do we expect a note? Where

[PATCH] D100829: [analyzer][docs] Highlight some differences between ArrayBound and V2

2021-04-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, vsavchenko, Szelethus, martong. Herald added subscribers: ASDenysPetrov, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. steakhal requested review of this revision

[PATCH] D100829: [analyzer][docs] Highlight some differences between ArrayBound and V2

2021-04-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/docs/analyzer/checkers.rst:2107 - // note: requires unix.Malloc or - // alpha.unix.MallocWithAnnotations checks enabled. void test() { There is no such checker, thus I removed this comment. Also, `unix.Malloc`

[PATCH] D100829: [analyzer][docs] Highlight some differences between ArrayBound and V2

2021-04-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 338786. steakhal added a comment. Add 'Limitations and bugs' section with a false-positive example. It would also help users classifying certain types of false-positive reports. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D97183: [analyzer] Add NoteTag for smart-ptr get()

2021-04-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D97183#2700810 , @vsavchenko wrote: > In D97183#2699336 , @steakhal wrote: > >> In D97183#2699080 , @RedDocMD wrote: >> >>> For the following fun

[PATCH] D92634: [Analyzer] Diagnose signed integer overflow

2021-01-05 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D92634#2478503 , @OikawaKirie wrote: > Besides, as far as I am thinking, the compiler optimizes the expression as it > is literally inferable, i.e. the result should be determinable literally > during compilation. Otherwise,

[PATCH] D93222: [RFC][analyzer] Introduce MacroExpansionContext to libAnalysis

2021-01-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 314857. steakhal marked 11 inline comments as done. steakhal added a comment. - move `MacroExpansionRangeRecorder` to `clang::detail` and mark it as a friend class - fix comment typo in `getExpandedMacroForLocation` - rename `getExpandedMacroForLocation` ->

[PATCH] D92634: [Analyzer] Diagnose signed integer overflow

2021-01-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Here is a link for our results on a few more projects. It might be useful for you. https://codechecker-demo.eastus.cloudapp.azure.com/Default/runs?run=D92634&items-per-page=50&sort-by=name&sort-desc=false Note: use the diff to filter only for the new reports. Repositor

[PATCH] D94476: [analyzer] Implement conversion from Clang diagnostics to PathDiagnostics.

2021-01-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Seems pretty straightforward and clean. The cleanup of the report's message should be reworked. Besides, that looks good to me. I think these cases should be tested as well: - [Warning, Warning, Warning] - [Warning, Note, Note] - [Warning, Note, Note, Warning, Note] -

[PATCH] D93223: [RFC][analyzer] Create MacroExpansionContext member in AnalysisConsumer and pass down to the diagnostics consumers

2021-01-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 316126. steakhal marked 2 inline comments as done. steakhal added a comment. Updates: - New the construction of `MacroExpansionContext` won't hook the `Preprocessor` in the constructor. Hooking is done via the `registerForPreprocessor(PP)` member function.

[PATCH] D93224: [RFC][analyzer] Use the MacroExpansionContext for macro expansions in plists

2021-01-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Updates: - Rebased. --- Unfortunately, I could not come up with a proper CTU implementation. It seems that when we load the AST/dump, no preprocessor events are replayed. Without those events, my `PPCallbacks` implementation and tokenwatcher would not record anything,

[PATCH] D93224: [RFC][analyzer] Use the MacroExpansionContext for macro expansions in plists

2021-01-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D93224#2493515 , @xazax.hun wrote: > In D93224#2493434 , @steakhal wrote: > >> How should I continue to get this working with CTU? > > We have two CTU modes. One loading the dump and the

[PATCH] D93224: [RFC][analyzer] Use the MacroExpansionContext for macro expansions in plists

2021-01-13 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D93224#2493710 , @steakhal wrote: > In D93224#2493515 , @xazax.hun wrote: > >> Could you validate that this solution works for the latter [ctu-on-demand]? > > Sure, I suspect that will h

[PATCH] D93224: [RFC][analyzer] Use the MacroExpansionContext for macro expansions in plists

2021-01-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. It seems quite a challenge to hook the `Preprocessor` for all possible configurations for every `CompilerInvocation`. The underlying machinery is somewhat complex and spaghetti to me. Here is what I suggest: For now, this expansion is better than the previous was. Macro

[PATCH] D94673: [analyzer][CTU] API for CTU macro expansions

2021-01-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 316861. steakhal edited the summary of this revision. steakhal set the repository for this revision to rG LLVM Github Monorepo. steakhal added a comment. Herald added a reviewer: shafik. Herald added a project: clang. Herald added a subscriber: cfe-commits. U

[PATCH] D94673: [analyzer][CTU] API for CTU macro expansions

2021-01-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/include/clang/CrossTU/CrossTranslationUnit.h:191 + /// source-location, empty is returned. + /// \note Macro expansion tracking for imported TUs are not implemented yet. + /// It returns empty unconditionally. -

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2021-01-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Please @ASDenysPetrov, give full context with the option `-U` when you export the diff from git. I would like to quickly swipe through the code before I accept this. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90157/new/ https://reviews.llvm.org/D901

[PATCH] D94177: [analyze] Add better support for leaks (and similar diagnostics)

2021-01-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. For the record, please rename this revision to have the `analyzer` tag. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94177/new/ https://reviews.llvm.org/D94177 ___ cfe-commits

[PATCH] D93222: [RFC][analyzer] Introduce MacroExpansionContext to libAnalysis

2021-01-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked an inline comment as done. steakhal added inline comments. Comment at: clang/lib/Analysis/MacroExpansionContext.cpp:210 +} \ No newline at end of file martong wrote: > Missing newline? I honestly don't know why was that not addressed by clang-for

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. It looks great. Thanks Vince! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 ___ cfe-commits mailing

[PATCH] D111542: [analyzer] Retrieve VLA extent from its redeclaration.

2021-10-11 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1663 // We can trust a const value or a value of a global initializer in main(). -const VarDecl *VD = VR->getDecl(); +const VarDecl *VD = VR->getDecl()->getMostRecentDecl();

[PATCH] D111623: [clang-tidy] Update documentation of check bugprone-unused-return-value [NFC].

2021-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. I checked the list, now it's complete. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111623/new/ https://reviews.llvm.org/D111623 _

[PATCH] D111640: [Analyzer][NFC] Add RangedConstraintManager to ConstraintAssignor

2021-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. It looks good. Do you think we could remove the `RangedConstraintManager` abstraction? It shouldn't be hard to get rid of it. Regardless, it's good to go, but let's wait for the child revis

[PATCH] D110913: [analyzer][solver] Handle simplification to ConcreteInt

2021-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Looks good to me. I very much like this. Check my nits inline. Given those are fixed I'm gonna accept this. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:392-397 +/// Try to simplify a given symbolic expre

[PATCH] D110357: [Analyzer] Extend ConstraintAssignor to handle remainder op

2021-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1619 + return true; +const SymExpr *LHS = Sym->getLHS(); +const llvm::APSInt &Zero = Comment at: clang/lib/StaticAnalyzer/Core/Ra

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/initialization.c:101-102 + +const int glob_arr3[]; // Incomplete array declaration +const int glob_arr3[4] = {1, 2, 3}; // Incomplete Array redeclaration +void foo() { ASDenysPetrov wrot

[PATCH] D99797: [analyzer] Implemented RangeSet::Factory::unite function to handle intersections and adjacency

2021-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I still need to chew through the code but on a high level, I think it looks correct. PS: the test coverage is outstanding! F19575968: unite-patch-line-coverage.zip Comment at: clang/lib/StaticAnalyzer/Core/RangeCo

[PATCH] D110357: [Analyzer] Extend ConstraintAssignor to handle remainder op

2021-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. BWT the following lines are uncovered by tests: L1627, L1651, L1758 Please adjust your tests accordingly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110357/new/ https://reviews.llvm.org/D110357

[PATCH] D111642: [Analyzer][solver] Simplification: reorganize equalities with adjustment

2021-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. The coverage report of the test shows that L2124 is uncovered. Please add a test demonstrating that path as well. I'm gonna come back to this tomorrow. Comment at: clang/test/Analysis/solver-sym-simplification-adjustment.c:36 + clang_analyzer_warnIfR

[PATCH] D110357: [Analyzer] Extend ConstraintAssignor to handle remainder op

2021-10-13 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. Excellent! All lines are covered. Great job. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1619 + return true; +const SymExpr *LHS = Sym->

[PATCH] D111245: [analyzer] Bifurcate on getenv() calls

2021-10-13 Thread Balázs Benics via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7fc150309d27: [analyzer] Bifurcate on getenv() calls (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits.

[PATCH] D111296: [analyzer] Introduce the assume-controlled-environment config option

2021-10-13 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGedde4efc66df: [analyzer] Introduce the assume-controlled-environment config option (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Gith

[PATCH] D110913: [analyzer][solver] Handle simplification to ConcreteInt

2021-10-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. I love this! The coverage is great and looks good. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110913/new/ https://reviews.llvm.org/D11091

[PATCH] D111642: [Analyzer][solver] Simplification: reorganize equalities with adjustment

2021-10-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2126-2130 + // Initiate the reorganization of the equality information. E.g., if we + // have `c + 1 == 0` then we'd like to express that `c == -1`. It makes + // s

[PATCH] D110357: [Analyzer] Extend ConstraintAssignor to handle remainder op

2021-10-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. In D110357#3066207 , @ASDenysPetrov wrote: > Ok. Let's see what the benefits it brings. According to our measurements, it has some effects but is probably difficult to draw clear conclusions. B

[PATCH] D110357: [Analyzer] Extend ConstraintAssignor to handle remainder op

2021-10-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Additionally to my previous observation, a surprising amount of the new findings are of `deadcode` detections, and most of them there are loops. Other than that, I've seen a true-positive report as well: F19624854: image.png At line

[PATCH] D110357: [Analyzer] Extend ConstraintAssignor to handle remainder op

2021-10-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. I see. Now it looks correct. Next time we shall have a z3 proof about the theory. `A => B` <=> `not(A) or B`. which is SAT only if `A and not(B)` UNSAT. a = z3.BitVec('a', 32) b = z3.BitVec('b', 32) zero = z3.BitVecVal(0, 32) s =

[PATCH] D111794: [analyzer][NFC] Add unittests for CallDescription and split the old ones

2021-10-18 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5644d152578f: [analyzer][NFC] Add unittests for CallDescription and split the old ones (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM

[PATCH] D111534: [analyzer][NFC] Refactor CallEvent::isCalled()

2021-10-18 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3ec7b91141da: [analyzer][NFC] Refactor CallEvent::isCalled() (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Changed prior to commit: https://reviews.llvm.

[PATCH] D111535: [analyzer] Allow matching non-CallExprs using CallDescriptions

2021-10-18 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG72d04d7b2b53: [analyzer] Allow matching non-CallExprs using CallDescriptions (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Mon

[PATCH] D111534: [analyzer][NFC] Refactor CallEvent::isCalled()

2021-10-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked 3 inline comments as done. steakhal added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:1289 + /// E.g. { "std", "vector", "data" } -> "vector", "std" + auto begin_qualified_name_parts() const { +return std::

[PATCH] D106681: [analyzer][NFC] Move a block from `getBindingForElement` to separate functions

2021-10-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. So, you return `None` instead of returning `UndefinedVal`. All in all, it looks good, aside from a couple stuff inline. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1636 + + // Array should be immutable. + const VarDecl *VD = VR->getDecl

[PATCH] D112013: [clang][ASTImporter] Fix for importing functions with EST_Unevaluated prototype.

2021-10-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Good job. Comment at: clang/unittests/AST/ASTImporterTest.cpp:6180 + ASSERT_FALSE(FromCtor->getTypeSourceInfo()); + // Set a TypeSourceInfo for the function, this state may occur in reality. + TypeSourceInfo *FromTSI = FromTU->getASTContext().getTri

[PATCH] D106681: [analyzer][NFC] Move a block from `getBindingForElement` to separate functions

2021-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I think it's fine, maybe `NFCi` is would be slightly more accurate, while stating the minor behavior change and the reason for doing so in the patch summary could further improve the visibility of this issue. That being said, since it actually changes some behavior, I'

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Why does `glob_invalid_index7()` and `glob_invalid_index8()` differ in behavior? I would expect that the analyzer produces the same `Loc` symbolic value for both cases thus, the array access should result in the same behavior regardless if `glob_arr6` is used, or acquir

[PATCH] D106681: [analyzer][NFCI] Move a block from `getBindingForElement` to separate functions

2021-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D106681#3074779 , @ASDenysPetrov wrote: > In D106681#3074678 , @steakhal > wrote: > >> I think it's fine, maybe `NFCi` is would be slightly more accurate, while >> stating the minor

[PATCH] D111982: [analyzer][NFC] Refactor llvm::isa<> usages in the StaticAnalyzer

2021-10-20 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG16be17ad4b13: [analyzer][NFC] Refactor llvm::isa<> usages in the StaticAnalyzer (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Changed prior to commit: ht

[PATCH] D99797: [analyzer] Implemented RangeSet::Factory::unite function to handle intersections and adjacency

2021-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:149 + +RangeSet RangeSet::Factory::unite(RangeSet Original, llvm::APSInt Point) { + return unite(Original, Range(ValueFactory.getValue(Point))); martong wrote: >

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1649-1653 + // NOTE: `VD` is always non-null if `Init` is non-null, so we can check for + // null only one of them. + const Expr *Init = VD->getAnyInitializer(VD); if (!Init) retu

[PATCH] D106681: [analyzer][NFCI] Move a block from `getBindingForElement` to separate functions

2021-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/initialization.c:103 +void glob_arr_index4() { + clang_analyzer_eval(glob_arr_no_init[2]); // expected-warning{{UNKNOWN}} +} martong wrote: > ASDenysPetrov wrote: > > steakhal wrote: > > > I'm prett

[PATCH] D112013: [clang][ASTImporter] Fix for importing functions with EST_Unevaluated prototype.

2021-10-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. I love it. Comment at: clang/unittests/AST/ASTImporterTest.cpp:6189 + // Check if the import was correct. + CXXConstructorDecl *ToCtor = *ToL->ctor_begin(); + const auto *ToFPT = ToCtor->getType()->getAs(); -

[PATCH] D106681: [analyzer][NFCI] Move a block from `getBindingForElement` to separate functions

2021-10-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/initialization.c:103 +void glob_arr_index4() { + clang_analyzer_eval(glob_arr_no_init[2]); // expected-warning{{UNKNOWN}} +} ASDenysPetrov wrote: > ASDenysPetrov wrote: > > steakhal wrote: > > > mar

[PATCH] D106102: [analyzer][solver] Introduce reasoning for not equal to operator

2021-10-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D106102#3081178 , @bjope wrote: > I get failures after having merged this patch: > [...] > Here is the crash.c input F19785350: crash.c > > > I see lots of these. Probably worth a revert.

[PATCH] D106102: [analyzer][solver] Introduce reasoning for not equal to operator

2021-10-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D106102#3082399 , @manas wrote: > Based on the information from debugger, the logs > show RangeSets `[0, 255]` and > `[INT_MIN, 0]` from different types >

[PATCH] D106681: [analyzer][NFCI] Move a block from `getBindingForElement` to separate functions

2021-10-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. Sorry for blocking the review of this one for so long. Comment at: clang/test/Analysis/initialization.c:103 +void glob_arr_index4() { + clang_analyzer_eval(glob_arr_no_init[2]); // expected-warning{{UNKNOWN}} +} --

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. Minor nits. Aside from that just land it. Thanks for the fix. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1654 + // NOTE: If `Init` is non-null, then a new `VD` is non-null for sure. So check + // `Init

[PATCH] D111642: [Analyzer][solver] Simplification: reorganize equalities with adjustment

2021-10-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. Awesome! So clean, and I also like the tests. Good job. Comment at: clang/test/Analysis/solver-sym-simplification-adjustment.c:58 + if (b != 1) { // b == 1 --> c

[PATCH] D112296: [Analyzer][solver] Handle adjustments in constraint assignor remainder

2021-10-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. <3 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112296/new/ https://reviews.llvm.org/D112296 _

[PATCH] D111247: [analyzer] Add std::string checker

2021-10-25 Thread Balázs Benics via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe1fdec875ff1: [analyzer] Add std::string checker (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repo

[PATCH] D105447: [analyzer] Allow cmake options to be passed to satest container

2021-10-25 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcaeef1995ab4: [analyzer] Allow cmake options to be passed to satest container (authored by manas, committed by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D111654: [analyzer] Retrieve a value from list initialization of multi-dimensional array declaration.

2021-10-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. This is an important step towards better handling of global initializer expressions. I'm looking forward to it. Although, I have concerns to address. Comment at: clang/lib/AST/Type.cpp:141-143 +/// Return an array with extents of the declared array ty

[PATCH] D105184: [analyzer] Ignore IncompleteArrayTypes in getStaticSize() for FAMs

2021-08-25 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG360ced3b8fd2: [analyzer] Ignore IncompleteArrayTypes in getStaticSize() for FAMs (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github

[PATCH] D89649: Fix __has_unique_object_representations with no_unique_address

2021-08-26 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGad59735f9d15: Fix __has_unique_object_representations with no_unique_address (authored by gbencze, committed by steakhal). Changed prior to commit: https://reviews.llvm.org/D89649?vs=303082&id=368823#to

[PATCH] D89651: [clang-tidy] Add bugprone-suspicious-memory-comparison check

2021-08-26 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3373e845398b: [clang-tidy] Add bugprone-suspicious-memory-comparison check (authored by gbencze, committed by steakhal). Changed prior to commit: https://reviews.llvm.org/D89651?vs=306679&id=368824#toc

[PATCH] D107078: [analyzer] Catch leaking stack addresses via stack variables

2021-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked an inline comment as done. steakhal added a comment. I plan to commit to this tomorrow. @NoQ @martong CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107078/new/ https://reviews.llvm.org/D107078 ___ cfe-commits mailing list cfe-

[PATCH] D107078: [analyzer] Catch leaking stack addresses via stack variables

2021-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Oh wait, it's not yet accepted by @NoQ. Then, consider this as a polite ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107078/new/ https://reviews.llvm.org/D107078 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D107756: [analyzer] Extend the documentation of MallocOverflow

2021-08-26 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6097a4192458: [analyzer] Extend the documentation of MallocOverflow (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo CH

[PATCH] D107756: [analyzer] Extend the documentation of MallocOverflow

2021-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I'm not exactly sure what does the sphinx build bot complain about: Warning, treated as error: /home/buildbot/llvm-build-dir/clang-sphinx-docs/llvm/build/tools/clang/docs/analyzer/checkers.rst:2159:Unexpected indentation. Unfortunately, I could not (yet) set up sp

[PATCH] D107756: [analyzer] Extend the documentation of MallocOverflow

2021-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/docs/analyzer/checkers.rst:2159-2160 +It tries to catch ``malloc(n * c)`` patterns, where: + - ``n``: a variable or member access of an object + - ``c``: a constant foldable integral + steakhal wrote: > Am I suppo

[PATCH] D107078: [analyzer] Catch leaking stack addresses via stack variables

2021-08-27 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6ad47e1c4fbf: [analyzer] Catch leaking stack addresses via stack variables (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107078/new/

[PATCH] D107804: [analyzer] MallocOverflow should consider comparisons only preceding malloc

2021-08-27 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG68088563fbad: [analyzer] MallocOverflow should consider comparisons only preceding malloc (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LL

[PATCH] D108912: [release][analyzer] Add 13.0.0 release notes

2021-08-30 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Maybe a couple other noteworthy commits: efa7df1682c2859dabe3646ee7dc01e68629417f : better R-value tracking. aa454dda2eed4e71081bc57b1f32dfce2486b177

[PATCH] D97699: [analyzer] Add InvalidPtrChecker

2021-08-31 Thread Balázs Benics via Phabricator via cfe-commits
steakhal resigned from this revision. steakhal added a comment. I think it looks good, I don't have much objection to this. I've also participated in the offline-review of this patch, so the current shape of this reflects my intentions, thus I resign. At the same time, I'm requesting others to ha

[PATCH] D75171: [Analyzer] Fix for incorrect use of container and iterator checkers

2021-09-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Herald added a subscriber: manas. In D75171#1954405 , @Szelethus wrote: > In D75171#1954279 , @sylvestre.ledru > wrote: > >> @baloghadamsoftware @Szelethus it would be great to have the na

[PATCH] D108230: [analyzer] Ignore single element arrays in getStaticSize() conditionally

2021-09-04 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG91c07eb8ee6e: [analyzer] Ignore single element arrays in getStaticSize() conditionally (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM

[PATCH] D108824: [analyzer] SValBuilder should have an easy access to AnalyzerOptions

2021-09-04 Thread Balázs Benics via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb97a96400a3f: [analyzer] SValBuilder should have an easy access to AnalyzerOptions (authored by steakhal). Herald added a project: clang. Herald adde

[PATCH] D109237: [clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter

2021-09-04 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd6ca91ea4245: [clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM

[PATCH] D109237: [clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter

2021-09-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D109237#2982674 , @shafik wrote: > LGTM, please run the `check-lldb` before landing this since lldb can be > sensitive to `ASTImporter` changes and it is nice to catch regressions there > before landing. The patch did not i

[PATCH] D109237: [clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter

2021-09-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:1493 +const SubstTemplateTypeParmPackType *T) { + ExpectedType ReplacedOrErr = import(QualType(T->getReplacedParameter(), 0)); + if (!ReplacedOrErr) martong wrote: > steakhal wrote: >

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-09-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Looks great. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1636-1640 + // Technically, only i == length is guaranteed to be null. + // However, such overflows should be caught before reaching this point; + // the only time such an access

[PATCH] D97699: [analyzer] Add InvalidPtrChecker

2021-09-10 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp:159 +// Note: This pointer has type 'const MemRegion *' +REGISTER_TRAIT_WITH_PROGRAMSTATE(EnvPtrRegion, const void *) + martong wrote: > Why is it `const void

[PATCH] D97699: [analyzer] Add InvalidPtrChecker

2021-09-13 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt:42 DynamicTypeChecker.cpp + cert/InvalidPtrChecker.cpp EnumCastOutOfRangeChecker.cpp Please, insert this in its sorted place. CHANGES SINCE LAST ACTION https:/

[PATCH] D108695: [analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it

2021-09-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D108695#2999378 , @uabelho wrote: > Hi @Szelethus > A couple of tests fail for me on trunk with this patch Uh, that's my unittest :D I suspect you are running some sort of CI where you set up Z3. I suspect we should slightl

[PATCH] D109836: [Analyzer] ConversionChecker: track back the cast expression

2021-09-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. LGTM. Thanks for fixing this. Should this checker remain in alpha in its current form? WDYT? @all Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

<    11   12   13   14   15   16