[PATCH] D125400: [clang][Analyzer] Add errno state to standard functions modeling.

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. It looks everything fine, given that the `alpha.unix.Errno` will depend on the `apimodeling.StdCLibraryFunctions`. This should do the expected errno state propagation by which the `Errno` checker can report diagnostics - WHILE the `StdCLibraryFunctions` still won't rep

[PATCH] D127836: [analyzer][NFC] Remove dead code and modernize surroundings

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 437120. steakhal added a comment. remove dead code from MallocChecker Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127836/new/ https://reviews.llvm.org/D127836 Files: clang/lib/StaticAnalyzer/Checkers/Basi

[PATCH] D127836: [analyzer][NFC] Remove dead code and modernize surroundings

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:931-934 + // void *getTag() const { + // static int Tag = 0; + // return static_cast(&Tag); + // } martong wrote: > Why should we keep this? Accident xD Repo

[PATCH] D127838: [analyzer][NFC] Remove dead field of UnixAPICheckers

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127838#3584911 , @martong wrote: > Umm, why this can't be part of D127836 ? It can be, but I wanted to still do this separately. The reasoning in the summary should nominate this to a sepa

[PATCH] D127839: [analyzer] Fix StreamErrorState hash bug

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. This change introduces a single new report: F23459650: image.png This makes me believe that this bug was not that important after all. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1278

[PATCH] D127306: [analyzer] Treat system globals as mutable if they are not const

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked an inline comment as done. steakhal added a comment. According to my measurements, this commit will change some reports, but nothing significant (<20) on our testset (except llvm which I did not include). But more importantly, no taint reports disappeared nor were introduced. Re

[PATCH] D127763: [analyzer] Relax constraints on const qualified regions

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. According to my measurements, this change has minor effects (1 new, 20 disappeared reports). The interesting reports had really long bug paths, so I think there were some default eval called functions down the line which made this patch surface this way. Repository:

[PATCH] D127836: [analyzer][NFC] Remove dead code and modernize surroundings

2022-06-15 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 rGf1b18a79b7f4: [analyzer][NFC] Remove dead code and modernize surroundings (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D127839: [analyzer] Fix StreamErrorState hash bug

2022-06-15 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 rG6c4f9998ae38: [analyzer] Fix StreamErrorState hash bug (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D127838: [analyzer][NFC] Remove dead field of UnixAPICheckers

2022-06-15 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 rG481f8603246c: [analyzer][NFC] Remove dead field of UnixAPICheckers (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D127742: [analyzer][NFC] Prefer using isa<> instead getAs<> in conditions

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG96ccb690a0ef: [analyzer][NFC] Prefer using isa<> instead getAs<> in conditions (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127742/n

[PATCH] D127306: [analyzer] Treat system globals as mutable if they are not const

2022-06-15 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 rGf4fc3f6ba319: [analyzer] Treat system globals as mutable if they are not const (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D127763: [analyzer] Relax constraints on const qualified regions

2022-06-15 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 rG929e60b6bd2f: [analyzer] Relax constraints on const qualified regions (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D127874: [analyzer] Reimplement UnreachableCodeChecker using worklists

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong, balazske, ASDenysPetrov, Szelethus, frederic-tingaud-sonarsource. Herald added subscribers: manas, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All.

[PATCH] D124244: [analyzer] add StoreToImmutable and ModelConstQualifiedReturn checkers

2022-06-16 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Sorry for my late reply. It feels like we have some serious obstacles. The `check::PostCall` handler wants to mark some memory region immutable. Currently, the checker creates a new //symbolic// memregion, spawned into the //immutable// memory space. After this it simp

[PATCH] D127923: [Diagnostics] Accept newline and format diag opts on first line

2022-06-16 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Please, consider updating the summary to clearly specify the motivation for making this change. It describes what this patch intends to do, but I'm about the why. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127923/new/

[PATCH] D122150: [clang][analyzer] Add checker for bad use of 'errno'.

2022-06-16 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. It looks great. Let me check the test coverage and the generated docs page it everything looks great. Comment at: clang/docs/analyzer/checkers.rst:2538 +may change value of ``errno`` if the call does not fail. +Therefore ``errno`` should only be used

[PATCH] D126891: [clang-tidy] The check should ignore final classes

2022-06-16 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. @aaron.ballman @njames93 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126891/new/ https://reviews.llvm.org/D126891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[PATCH] D122150: [clang][analyzer] Add checker for bad use of 'errno'.

2022-06-16 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.cpp:73 +REGISTER_TRAIT_WITH_PROGRAMSTATE(ErrnoState, ErrnoCheckState) + You will need this to get it compiled. Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D127874: [analyzer] Reimplement UnreachableCodeChecker using worklists

2022-06-16 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127874#3588786 , @martong wrote: >> If some checker placed a sink node into some block, the successors of the >> sink block was marked unreachable previously. This leads to an unpleasant >> situation from the user's point o

[PATCH] D122150: [clang][analyzer] Add checker for bad use of 'errno'.

2022-06-16 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Awesome! The generated doc section looks great. The test coverage it excellent, but I would recommend adding tests for covering the following lines: - `ErrnoChecker.cpp:99` - `ErrnoModeling.cpp:259` - `ErrnoModeling.cpp:264` There are two other uncovered cases, but th

[PATCH] D125400: [clang][Analyzer] Add errno state to standard functions modeling.

2022-06-16 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In the `describeErrnoCheckState()` the `Errno_MustBeChecked` is uncovered by tests. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:410 +/// Many of the descendant classes use this value. +errno_modeling::ErrnoChec

[PATCH] D127277: [clang][analyzer] Fix StdLibraryFunctionsChecker 'mkdir' return value.

2022-06-17 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. It feels like the parent revision is not correct. Land it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127277/new/ https://reviews.llvm.org/D127277 __

[PATCH] D128068: [analyzer] Do not emit redundant SymbolCasts

2022-06-18 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. > We can't just do that check in `evalCast` because there are many additonal > logic before we'd end up in `makeNonLoc`. I'm not exactly up to date. Could you please extend the summary wit

[PATCH] D126779: [analyzer] Fix assertion in simplifySymbolCast

2022-06-18 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 Comment at: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:1082 + // FIXME support cast from non-integers. + // E.g (char)(double)(double x) -> (char)(double x) +

[PATCH] D117229: [Analyzer] Produce SymbolCast for pointer to integer cast

2022-06-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/symbol-simplification-mem-region-to-int-cast.cpp:23 + clang_analyzer_eval(p == 0);// expected-warning{{TRUE}} + clang_analyzer_eval(p_as_integer == 0); // expected-warning{{UNKNOWN}} +

[PATCH] D127923: [Diagnostics] Accept newline and format diag opts on first line

2022-06-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Thanks for updating the summary. I'm not too confident around diagnostics though. I'm going to piggyback on @scott.linder's comments. I think they are on the point. nit: I'm not sure if `size_t` is a thing in c++, `std::size_t` is though. Comment at

[PATCH] D125400: [clang][Analyzer] Add errno state to standard functions modeling.

2022-06-19 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, good job. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125400/new/ https://reviews.llvm.org/D125400

[PATCH] D122150: [clang][analyzer] Add checker for bad use of 'errno'.

2022-06-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/StaticAnalyzer/Checkers/ErrnoChecker.cpp:47 + /// Indicates if a read (load) of \c errno is allowed in a non-condition part + /// of \c if, \c

[PATCH] D127643: [Static Analyzer] Structured bindings to data members

2022-06-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I missed this commit because it was not tagged by "[analyzer]". What is the community preference about tagging CSA commits? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127643/new/ https://reviews.llvm.org/D127643 __

[PATCH] D126891: [clang-tidy] The check should ignore final classes

2022-06-21 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. steakhal marked an inline comment as done. Closed by commit rGd9afb8c3e8fd: [clang-tidy] cppcoreguidelines-virtual-class-destructor should ignore final… (authored by steakhal). Changed prior to commit: https://reviews.ll

[PATCH] D128535: [analyzer] Improve loads from reinterpret-cast fields

2022-06-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong, ASDenysPetrov. Herald added subscribers: manas, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D128535: [analyzer] Improve loads from reinterpret-cast fields

2022-06-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. No runtime diff. No crashes. 8 disappeared: - 4 core.CallAndMessage (1st arg is uninitialized) - 2 alpha.deadcode.UnreachableCode (sinked before reaching it) - 2 core.UndefinedBinaryOperatorResult 2 new reports: - 1 core.UndefinedBinaryOperatorResult - 1 alpha.security

[PATCH] D125547: [analyzer][solver] Handle UnarySymExpr in SMTConv

2022-05-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. I think it looks greatt There are a couple questions you need to think about, but I don't insist about changing anything if the code works passed widescale testing. Comment at: clang/include/clang/StaticAnalyzer/Core/P

[PATCH] D124758: [analyzer] Implement assume in terms of assumeDual

2022-05-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. This commit introduced a serious runtime regression on this code: #define DEMONSTRATE_HANG typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint64_t; void clang_analyzer_numTimesReached(void); int filter_slice_wor

[PATCH] D126406: [analyzer] Return from reAssume if State is posteriorly overconstrained

2022-05-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Thanks for the quick response! Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h:127 + +public: bool isPosteriorlyOverconstrained() const { This shouldnt be the way. Consider fwd declaring and making

[PATCH] D126406: [analyzer] Return from reAssume if State is posteriorly overconstrained

2022-05-26 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. Typo; other than that LGTM Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h:118 + // Make internal constraint solver entities friends so

[PATCH] D126481: [analyzer] Handle SymbolCast in SValBuilder

2022-05-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:1359 + return cache(S, + SVB.evalCast(Op, S->getType(), S->getOperand()->getType())); +} Hoist this common subexpression.

[PATCH] D126124: [analyzer][NFC] Inline ExprEngine::evalComplement

2022-05-27 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 rG7a2d6dea73b5: [analyzer][NFC] Inline ExprEngine::evalComplement (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D126125: [analyzer][NFC] Inline ExprEngine::evalMinus

2022-05-27 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 rGee8987d585e7: [analyzer][NFC] Inline ExprEngine::evalMinus (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D126128: [analyzer][NFC] Inline loc::ConcreteInt::evalBinOp

2022-05-27 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 rGf6eab4376432: [analyzer][NFC] Inline loc::ConcreteInt::evalBinOp (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/D126128

[PATCH] D126129: [analyzer][NFC] Remove unused nonloc::ConcreteInt::evalBinOp

2022-05-27 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 rG81066603a8b9: [analyzer][NFC] Remove unused nonloc::ConcreteInt::evalBinOp (authored by steakhal). Changed prior to commit: https://reviews.llvm.o

[PATCH] D126130: [analyzer][NFC] Remove unused SVal::hasConjuredSymbol

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG813acb12972e: [analyzer][NFC] Remove unused SVal::hasConjuredSymbol (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126130/new/ https:

[PATCH] D126123: [analyzer][NFC] Use MemRegion::getRegion()'s return value unconditionally

2022-05-27 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 rG3a666dd37a06: [analyzer][NFC] Use MemRegion::getRegion()'s return value unconditionally (authored by steakhal). Repository: rG LLVM Github Monore

[PATCH] D125707: [analyzer][NFC] Remove unused friend SVal declarations

2022-05-27 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 rGd8def22f7be1: [analyzer][NFC] Remove unused friend SVal declarations (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D125706: [analyzer][NFC] Use idiomatic classof instead of isKind

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe37b287998a7: [analyzer][NFC] Use idiomatic classof instead of isKind (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/D125706?vs=429767&id=432493#toc Repository: rG LLVM Git

[PATCH] D125708: [analyzer][NFC] Remove unused default SVal constructors

2022-05-27 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 rG7727d2abece6: [analyzer][NFC] Remove unused default SVal constructors (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D126198: [analyzer][NFCi] Annotate major nonnull returning functions

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf13050eca356: [analyzer][NFCi] Annotate major nonnull returning functions (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/D126198?vs=431379&id=432498#toc Repository: rG LLVM

[PATCH] D126068: [llvm][clang][bolt][NFC] Use llvm::less_first() when applicable

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3988bd13988a: [llvm][clang][bolt][NFC] Use llvm::less_first() when

[PATCH] D126067: [analyzer] Drop the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I'm hesitating about landing this. I think I'll mark this flag deprecated instead, to emit a warning when using this flag. So, `clang-15` would emit a warning for this, and `clang-16` and above we can remove this flag completely. WDYT @martong ? Repository: rG LLVM

[PATCH] D126215: [analyzer] Deprecate `-analyzer-store region` flag

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 432509. steakhal edited the summary of this revision. steakhal added a comment. - Specify exactly that we propose one release deprecation, then removal. - Test the help message. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D126067: [analyzer] Deprecate the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 432525. steakhal retitled this revision from "[analyzer] Drop the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag" to "[analyzer] Deprecate the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag". steakhal edited the summary of this revision. steakhal

[PATCH] D126067: [analyzer] Deprecate the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I plan to land this stack next Wednesday. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126067/new/ https://reviews.llvm.org/D126067 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D126198: [analyzer][NFCi] Annotate major nonnull returning functions

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. A sanitizer buildbot caught a wrong annotation, fixed by e651ed8621c3719937517ddb0b0815b18ec888e4 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126198

[PATCH] D126534: [analyzer] Deadstore static analysis: Fix false positive on C++17 assignments

2022-05-27 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I haven't checked the implementation; the Deadstores checker was always a nemesis for me. Off the top of my head, I think in the analyzer we have the `elide-constructors=true/false` analyzer config option, which quotes: > Whether elidable C++ copy-constructors and mov

[PATCH] D126560: [analyzer][NFC] SimpleSValBuilder simplification: Remove superfluous workaround code and track Assume call stack rather

2022-06-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. This isn't an NFC change. It's more than a refactor/cosmetic change. Please run some benchmarks to validate the assumed performance characteristics. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h:156 + private:

[PATCH] D126560: [analyzer][NFC] SimpleSValBuilder simplification: Remove superfluous workaround code and track Assume call stack rather

2022-06-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D126560#3549570 , @martong wrote: > In D126560#3549408 , @steakhal > wrote: > >> This isn't an NFC change. It's more than a refactor/cosmetic change. > > Still, there is no visible ch

[PATCH] D126707: [analyzer][NFC] Move overconstrained check from reAssume to assumeDualImpl

2022-06-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. LGTM; measure performance implications. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h:117-120 // Make internal constraint solver entities friends so they can access the // overconstrained-related functions. We

[PATCH] D126560: [analyzer][NFC] SimpleSValBuilder simplification: Remove superfluous workaround code and track Assume call stack rather

2022-06-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h:21 #include "llvm/ADT/Optional.h" +#include "llvm/ADT/SmallSet.h" #include "l

[PATCH] D126801: [analyzer][NFC] Add partial specializations for ProgramStateTraits

2022-06-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong, balazske, ASDenysPetrov. Herald added subscribers: manas, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project:

[PATCH] D126802: [analyzer][NFC] Uplift checkers after D126801

2022-06-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong, ASDenysPetrov. Herald added subscribers: manas, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D126803: [llvm][analyzer][NFC] Introduce SFINAE for specializing FoldingSetTraits

2022-06-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong, ASDenysPetrov, bzcheeseman. Herald added subscribers: manas, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a projec

[PATCH] D122150: [clang][analyzer] Add checker for bad use of 'errno'.

2022-06-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. D126801 should simplify the reinterpret casts. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:558 + InAlpha, + Hide>, // ?? + ]>, I think we ha

[PATCH] D126560: [analyzer] Track assume call stack to detect fixpoint

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. Looks good! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126560/new/ https://reviews.llvm.org/D126560 ___ cfe-commits mailing list cfe-commits@

[PATCH] D126560: [analyzer] Track assume call stack to detect fixpoint

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Express why this is not an NFC patch in the summary. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126560/new/ https://reviews.llvm.org/D126560 ___ cfe-commits mailing list cfe-

[PATCH] D126878: [analyzer] Remove NotifyAssumeClients

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Measure if it changes any reports. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126878/new/ https://reviews.llvm.org/D126878 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D126801: [analyzer][NFC] Add partial specializations for ProgramStateTraits

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 433734. steakhal marked an inline comment as done. steakhal added a comment. - host common implementation CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126801/new/ https://reviews.llvm.org/D126801 Files: clang/include/clang/StaticAnalyzer/Core/P

[PATCH] D126802: [analyzer][NFC] Uplift checkers after D126801

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 433737. steakhal marked 2 inline comments as done. steakhal added a comment. - replace `auto` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126802/new/ https://reviews.llvm.org/D126802 Files: clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.cpp

[PATCH] D126803: [llvm][analyzer][NFC] Introduce SFINAE for specializing FoldingSetTraits

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 433738. steakhal added a comment. - rebase CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126803/new/ https://reviews.llvm.org/D126803 Files: clang/include/clang/Basic/SourceLocation.h clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp

[PATCH] D116593: Fix `performance-unnecessary-value-param` for template specialization

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:205-208 +- Fixed a crash in :doc:`performance-unnecessary-value-param + ` when the specialization + template has an unnecessary value paramter. Removed the fix for a template. + ---

[PATCH] D126891: [clang-tidy] The check should ignore final classes

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: aaron.ballman, njames93, LegalizeAdulthood, whisperity. Herald added subscribers: carlosgalvezp, martong, rnkovacs, kbarton, xazax.hun, nemanjai. Herald added a project: All. steakhal requested review of this revision. Herald added a proje

[PATCH] D126803: [llvm][analyzer][NFC] Introduce SFINAE for specializing FoldingSetTraits

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: llvm/include/llvm/ADT/FoldingSet.h:260 /// to FoldingSets that were not originally designed to have that behavior. -template struct FoldingSetTrait - : public DefaultFoldingSetTrait {}; +template +struct FoldingSetTrait : public Defa

[PATCH] D126803: [llvm][analyzer][NFC] Introduce SFINAE for specializing FoldingSetTraits

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 433791. steakhal marked 2 inline comments as done. steakhal added a comment. - Named SFINAE type parameter. - Using default return value of `enable_if_t` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126803/new

[PATCH] D126801: [analyzer][NFC] Add partial specializations for ProgramStateTraits

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. steakhal marked an inline comment as done. Closed by commit rG33ca5a447e7f: [analyzer][NFC] Add partial specializations for ProgramStateTraits (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/D126

[PATCH] D126802: [analyzer][NFC] Uplift checkers after D126801

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcf1f1b7240a3: [analyzer][NFC] Uplift checkers after D126801 (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126802/new/ https://review

[PATCH] D126803: [llvm][analyzer][NFC] Introduce SFINAE for specializing FoldingSetTraits

2022-06-02 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 rG7d24641f8916: [llvm][analyzer][NFC] Introduce SFINAE for specializing FoldingSetTraits (authored by steakhal). Repository: rG LLVM Github Monorepo

[PATCH] D124244: [analyzer] add StoreToImmutable and ModelConstQualifiedReturn checkers

2022-06-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Any update on this. I'm really excited about this one. Let me know if something blocks you. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124244/new/ https://reviews.llvm.org/D124244 ___ cfe-commits mailing list cfe

[PATCH] D126891: [clang-tidy] The check should ignore final classes

2022-06-03 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D126891#3554039 , @carlosgalvezp wrote: > Hmm, `MostDerived` **does** have a public virtual destructor in your example > already - if the base class destructor is virtual, the child class destructor > is virtual. In that se

[PATCH] D126891: [clang-tidy] The check should ignore final classes

2022-06-03 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:170 + ` involving + `final` classes. The check will not diagnose `final` marked classes, since + those cannot be used as base classes, consequently they can not violate the car

[PATCH] D126878: [analyzer] Remove NotifyAssumeClients

2022-06-07 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. Great! Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126878/new/ https://reviews.llvm.org/D126878 _

[PATCH] D127105: [analyzer] Fix null pointer deref in CastValueChecker

2022-06-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Likely related to https://github.com/llvm/llvm-project/issues/55715. Mention this in the summary as `Fixes #55715`. Comment at: clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp:168 -CastToTy->getAsCXXRecordDecl()->getNameAsString() :

[PATCH] D127105: [analyzer] Fix null pointer deref in CastValueChecker

2022-06-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Vince, please update the summary - it looks really weird. Along with that the content of it might not be much useful, as we have a test case to demonstrate the crash; you can probably remove those dumps etc. Otherwise LGTM. Comment at: clang/test/Ana

[PATCH] D127105: [analyzer] Fix null pointer deref in CastValueChecker

2022-06-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/cast-value-notes.cpp:311 +public: + template void b() { isa(*this); } +}; vabridgers wrote: > steakhal wrote: > > This gotta be the `getAs`. Please try to reconstruct the 'feel' of it; > > like re

[PATCH] D126891: [clang-tidy] The check should ignore final classes

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 435054. steakhal marked an inline comment as done. steakhal added a comment. - rebase - use double-backticks for the keyword `final` in the Release Notes. polite ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D126215: [analyzer] Deprecate `-analyzer-store region` flag

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I believe, the silence from the code owner means that he agrees with this change. I'll land it tomorrow. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126215/new/ https://reviews.llvm.org/D126215

[PATCH] D127105: [analyzer] Fix null pointer deref in CastValueChecker

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Submitted a backport request to land this in `clang-14.0.5`, since many `llvm` devs might be affected by this crash due to `clangd` and `clang-tidy` integration. https://github.com/llvm/llvm-project/issues/55937 Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D126560: [analyzer] Track assume call stack to detect fixpoint

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. New assertion failure: llvm-project/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:72: bool isLeftShiftResultUnrepresentable(const clang::BinaryOperator *, clang::ento::CheckerContext &): Assertion `LHS && RHS && "Values unknown, inconsistent state"' faile

[PATCH] D127285: [analyzer] Fix assertion failure after getKnownValue call

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. LGTM Schedule a measurement to see what changes. Let's hope it won't introduce more crashes. If everything checks out, it gets approved. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:25-28 + // Query the constraint manager whether t

[PATCH] D127285: [analyzer] Fix assertion failure after getKnownValue call

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Check the summary for typos. Try to mark named entities like `this`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127285/new/ https://reviews.llvm.org/D127285 ___ cfe-commits m

[PATCH] D127277: [clang][analyzer] Fix StdLibraryFunctionsChecker 'mkdir' return value.

2022-06-08 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. Note in the summary that this patch affects: - `mkdir`, `mkdirat` - `mknod`, `mknodat` > The checker modeled these functions with a >= 0 return value on success which > is incorrect. Tec

[PATCH] D127285: [analyzer] Fix assertion failure after getKnownValue call

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127285#3566198 , @martong wrote: > In D127285#3566034 , @steakhal > wrote: > >> ... Try to mark named entities like `this`. > > Could you please elaborate? Oh sure. The `SimpleSValB

[PATCH] D126779: [analyzer] Fix assertion in simplifySymbolCast

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Oh I forgot to submit my review. My bad. Please investigate why we have two double casts there. Comment at: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:1082 + // FIXME support cast from non-integers. + // E.g (char)(double)(double x) -> (char)(dou

[PATCH] D127306: [analyzer] Treat system globals as mutable if they are not const

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong, ASDenysPetrov, balazske, Szelethus, gamesh411. Herald added subscribers: manas, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All. steakhal requested

[PATCH] D124244: [analyzer] add StoreToImmutable and ModelConstQualifiedReturn checkers

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D124244#3521728 , @steakhal wrote: > I found this report at `vim/src/term.c` (https://github.com/vim/vim.git at > `v8.2.1920`): > F23102904: image.png > > I'm not sure what the exact type

[PATCH] D127285: [analyzer] Fix assertion failure after getKnownValue call

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:25-28 + // Query the constraint manager whether the SVal has only one possible + // (integer) value.

[PATCH] D117229: [Analyzer] Produce SymbolCast for pointer to integer cast

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Looks correct to me. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h:110-112 + SVal simplifySymbolCast(SymbolRef SE, QualType CastTy); + You don't need to have gap between these two. They belong in t

[PATCH] D127306: [analyzer] Treat system globals as mutable if they are not const

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127306#3566761 , @martong wrote: >> In theory, the engine should propagate taint in default eval call. If that >> would be the case, we would still have this report. > > How complex would it be to add the taint propagation t

[PATCH] D127277: [clang][analyzer] Fix StdLibraryFunctionsChecker 'mkdir' return value.

2022-06-08 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. This looks like a standalone patch. Feel free to rebase to `main` and land it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127277/new/ https://reviews.llvm.org/D127277 ___ cfe

[PATCH] D127389: [analyzer] Print the offending function at EndAnalysis crash

2022-06-09 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: NoQ, martong. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. steak

[PATCH] D127306: [analyzer] Treat system globals as mutable if they are not const

2022-06-09 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127306#3570083 , @martong wrote: > In D127306#3566984 , @steakhal > wrote: > >> In D127306#3566761 , @martong >> wrote: >> In theory,

<    5   6   7   8   9   10   11   12   13   14   >