[PATCH] D97277: [analyzer] Eliminate dispatchCast, evalCastFromNonLoc and evalCastFromLoc functions from SValBuilder

2021-03-09 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Please, @ASDenysPetrov, mention `NFC` in the commit message when you commit this change. The same applies to all of your NFC changes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97277/new/ https://reviews.llvm.org/D97277

[PATCH] D82900: [analyzer][Z3-refutation] Add statistics tracking invalidated bug report classes

2021-03-10 Thread Balázs Benics via Phabricator via cfe-commits
steakhal abandoned this revision. steakhal added a comment. It might be useful in the future, but right now, I'm not interested in upstreaming this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82900/new/ https://reviews.llvm.org/D82900

[PATCH] D82856: [analyzer][Z3-refutation] Add statistics for refutation visitor

2021-03-10 Thread Balázs Benics via Phabricator via cfe-commits
steakhal abandoned this revision. steakhal added a comment. It might be useful in the future, but right now, I'm not interested in upstreaming this. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82856/new/ https://reviews.llvm.org/D82856 ___

[PATCH] D96586: [analyzer][CTU][NFC] Add an extra regression test

2021-03-10 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D96586#2616292 , @thakis wrote: > The test doesn't pass: http://45.33.8.238/linux/41341/step_7.txt > > I think you just need to say `rm -rf` instead of `rm -r` on line 3 (?) I hope a94ac467c2974d9afe68f3fe6cff27bd19bcfad0

[PATCH] D97874: [analyzer] Improve SVal cast from integer to bool using known RangeSet

2021-03-10 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I would suggest **not** merging this patch. Circumventing the `assume` machinery could cause potential crashes. By tracking equivalence classes and whatnot, our solver is becoming more and more capable. Doing a bifurcation, then realizing that the current path is infea

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2021-03-10 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I'm looking forward to this patch. Comment at: clang/test/Analysis/string.c:367-373 +void *func_strcpy_no_assertion(); +char ***ptr_strcpy_no_assertion; +void strcpy_no_assertion() { + *(unsigned char **)ptr_strcpy_no_assertion = (unsigned char *)(fu

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-03-10 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D96090#2607387 , @ASDenysPetrov wrote: > Actually many cases don't need to know an exact **original** type. Some cases > can extract the //type// from `SVal` (`SymbolVal`, `ConcreteInt`) Other cases > need it from outside (`

[PATCH] D97874: [analyzer] Improve SVal cast from integer to bool using known RangeSet

2021-03-10 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D97874#2616660 , @vsavchenko wrote: > @steakhal I personally don't see any fundamental problems with this patch Then, I guess, it should be fine :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97874/new/ https://re

[PATCH] D98341: [analyzer][solver] Prevent infeasible states (PR49490)

2021-03-11 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. Looks good btw. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1400-1406 + LLVM_ATTRIBUTE_UNUSED inline bool areFeasible(ConstraintRangeTy Constraints) { +return llvm::none_of( +Const

[PATCH] D98341: [analyzer][solver] Prevent infeasible states (PR49490)

2021-03-11 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/PR49490.cpp:12 + +int *ints; +int oob_access(); I think you can remove this line. We already have a global variable to be invalidated by the evaluation of `oob_access()` call. Repository: rG LLV

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-03-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D96976#2622039 , @RedDocMD wrote: > @steakhal, your views? I'm somewhat busy. If it's not urgent, I would postpone this. Ping me in a few weeks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D113558: [clang-tidy] Fix cppcoreguidelines-virtual-base-class-destructor in macros

2021-11-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 387189. steakhal marked 2 inline comments as done. steakhal added a comment. Add fixme comment for: class FooBar2 { protected: virtual CONCAT(~Foo, Bar2()); // FIXME: We should have a fixit for this. }; CHANGES SINCE LAST ACTION https://reviews

[PATCH] D113587: [analyzer][NFC] Separate CallDescription from CallEvent

2021-11-15 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0b9d3a6e53e6: [analyzer][NFC] Separate CallDescription from CallEvent (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo

[PATCH] D114006: [analyzer][NFC] Enable access to CodeGenOptions from analyzer's instances.

2021-11-16 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. Sweet! I think commit titles are not punctuated, even though they start with an uppercase letter. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-17 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: aaron.ballman, whisperity, alexfh, hokein, JonasToth, courbet, ymandel. Herald added subscribers: carlosgalvezp, martong, rnkovacs, kbarton, kristof.beyls, xazax.hun, nemanjai. steakhal requested review of this revision. Herald added a pro

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Thanks for the valuable feedback. > D114105#inline-1089282 Let me clarify my motivation, and why I'm interested in bitfields, conversions, and shift expressions. Bitfields can be quite tricky. It turns out doing anythin

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 388240. steakhal marked 2 inline comments as done. steakhal edited the summary of this revision. steakhal added a comment. - added more tests - add a detailed comment about the situation we suppress - see through parenExprs CHANGES SINCE LAST ACTION https

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:105 + has(memberExpr(hasDeclaration(fieldDecl(isBitField(, + hasParent( + binaryOperator(anyOf(hasOperatorName("<<"),

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-bitfields.cpp:62 +void test(NoBitfield x) { + // no-warning in this function, except for operator+. + static_assert(is_same_v); Outda

[PATCH] D113558: [clang-tidy] Fix cppcoreguidelines-virtual-base-class-destructor in macros

2021-11-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. ping Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-virtual-class-destructor.cpp:288 +protected: + virtual CONCAT(~Foo, Bar2()); // no-fixit +}; whisperity wrote: > whisperity wrote: > > It is strange that t

[PATCH] D113668: [ASTImporter][NFC] Dump decl name at assertion violation

2021-11-19 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf3753ad77450: [ASTImporter][NFC] Dump decl name at assertion violation (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo

[PATCH] D113401: [analyzer][docs] Ellaborate the docs of cplusplus.StringChecker

2021-11-19 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbf55b9f0d0e9: [analyzer][docs] Ellaborate the docs of cplusplus.StringChecker (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Mo

[PATCH] D113754: [Analyzer][Core] Simplify IntSym in SValBuilder

2021-11-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Great news, thanks. Comment at: clang/test/Analysis/svalbuilder-simplify-intsym.cpp:18 +return; + clang_analyzer_eval(x == 77); // expected-warning{{TRUE}} + (void)(x * y); extra spaces? Repository: rG LLVM Github Mon

[PATCH] D114254: [libtooling][clang-tidy] Fix crashing on rendering invalid SourceRanges

2021-11-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: aaron.ballman, njames93, klimek, alexfh. Herald added subscribers: carlosgalvezp, martong, xazax.hun. steakhal requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Invalid Sou

[PATCH] D114256: [clang-tidy] Fix crashing altera-struct-pack-align on invalid RecordDecls

2021-11-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: ffrankies, aaron.ballman, alexfh, njames93. Herald added subscribers: carlosgalvezp, martong, xazax.hun. steakhal requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. https://

[PATCH] D113589: [analyzer][NFC] Introduce CallDescriptionSets

2021-11-19 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 rGd448fcd9b223: [analyzer][NFC] Introduce CallDescriptionSets (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-com

[PATCH] D113590: [analyzer][NFC] Introduce CallDescription::matches() in addition to isCalled()

2021-11-19 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 rG6c512703a9e6: [analyzer][NFC] Introduce CallDescription::matches() in addition to isCalled() (authored by steakhal). Herald added a project: clang. H

[PATCH] D113591: [analyzer][NFC] Switch to using CallDescription::matches() instead of isCalled()

2021-11-19 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 rGf18da190b0db: [analyzer][NFC] Switch to using CallDescription::matches() instead of isCalled() (authored by steakhal). Herald added a project: clang.

[PATCH] D113592: [analyzer][NFC] Demonstrate the use of CallDescriptionSet

2021-11-19 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 rG9ad0a90baa8c: [analyzer][NFC] Demonstrate the use of CallDescriptionSet (authored by steakhal). Herald added a project: clang. Herald added a subscri

[PATCH] D113593: [analyzer][NFC] CallDescription should own the qualified name parts

2021-11-19 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 rGde9d7e42aca2: [analyzer][NFC] CallDescription should own the qualified name parts (authored by steakhal). Herald added a project: clang. Herald added

[PATCH] D113594: [analyzer][NFC] Consolidate the inner representation of CallDescriptions

2021-11-19 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 rG97f1bf15b154: [analyzer][NFC] Consolidate the inner representation of CallDescriptions (authored by steakhal). Herald added a project: clang. Herald

[PATCH] D113595: [analyzer][NFC] Use enum for CallDescription flags

2021-11-19 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 rGe6ef134f3c77: [analyzer][NFC] Use enum for CallDescription flags (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cf

[PATCH] D114254: [libtooling][clang-tidy] Fix crashing on rendering invalid SourceRanges

2021-11-22 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 388850. steakhal marked an inline comment as done. steakhal added a comment. - prefer `empty()` over `size() == 0` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114254/new/ https://reviews.llvm.org/D114254 Files: clang-tools-extra/clang-tidy/Cla

[PATCH] D114256: [clang-tidy] Fix crashing altera-struct-pack-align on invalid RecordDecls

2021-11-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114256/new/ https://reviews.llvm.org/D114256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D113753: [Analyzer][Core] Better simplification in SimpleSValBuilder::evalBinOpNN

2021-11-23 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! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113753/new/ https://reviews.llvm.org/D113753 ___

[PATCH] D103317: [Analyzer][Core] Make SValBuilder to better simplify svals with 3 symbols in the tree

2021-11-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D103317#3148868 , @martong wrote: > In D103317#3127318 , @steakhal > wrote: > >> To me at least, the patch looks good. >> Please post some comparative measurements to demonstrate it w

[PATCH] D103317: [Analyzer][Core] Make SValBuilder to better simplify svals with 3 symbols in the tree

2021-11-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:1105 - // FIXME: Add support for SymExprs. return nullptr; martong wrote: > steakhal wrote: > > Where did you address this FIXME? > I didn't, but this `FIXME` be

[PATCH] D114256: [clang-tidy] Fix crashing altera-struct-pack-align on invalid RecordDecls

2021-11-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 389225. steakhal marked an inline comment as done. steakhal added a comment. - update comments - move `no-crash` comment inline to the class member declaration CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114256/new/ https://reviews.llvm.org/D1142

[PATCH] D114256: [clang-tidy] Fix crashing altera-struct-pack-align on invalid RecordDecls

2021-11-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D114256#3149009 , @martong wrote: > What happens if this checker runs on a forward declared class? The matcher `recordDecl(isStruct(), **isDefinition()**, unless(isExpansionInSystemHeader()))` filters that case. Thanks for

[PATCH] D114454: [NFC][AIX]Disable unstable CSA tests failing on AIX

2021-11-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Thanks for fixing this @stevewan! I think disabling a test is worse than actually fixing it, although I can see the frustration it causes. Yet, I would propose something else. This is just a static analyzer checker doing its own thing. What if we were pinning the targ

[PATCH] D114454: [NFC][AIX]Disable unstable CSA tests failing on AIX

2021-11-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added reviewers: jlebar, chandlerc. steakhal added subscribers: jlebar, chandlerc. steakhal added a comment. I think D21810 (commit ) was related to a triple issue in

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 389496. steakhal edited the summary of this revision. steakhal added a comment. Bitshifts have nothing to do with this issue, thus I'm simply matching for bitfield -> `int` implicit casts due to promotions. CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I think it's in pretty good shape, please have a look to help me move this forward. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114105/new/ https://reviews.llvm.org/D114105 ___ cfe-commits mailing list cfe-commits

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 389711. steakhal marked an inline comment as done. steakhal added a comment. Added the `test_parameter_passing()` tests, demonstrating the implicit conversion triggered by parameter passing. It turns out my previous revision suppressed a useful report. Now,

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-bitfields.cpp:1 +// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \ +// RUN: -std=c++17 -- -target x86_64-unknown-linux ---

[PATCH] D114622: [clang-tidy][analyzer] Fix false-positive in IdenticalExprChecker and misc-redundant-expression

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: aaron.ballman, alexfh, hokein, courbet, NoQ, xazax.hun, martong, whisperity, davrec. Herald added subscribers: carlosgalvezp, manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsof

[PATCH] D103317: [Analyzer][Core] Make SValBuilder to better simplify svals with 3 symbols in the tree

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D103317#3155191 , @martong wrote: >> Please repeat the measurement for `openssl`. There must have been some >> interference in the memory consumption. Aside from that the results look >> great. > > I did. Average memory usag

[PATCH] D114619: [Analyzer][solver] Do not remove the simplified symbol from the eq class

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I see. Simplification is always good. Let's measure and compare the runtime characteristics before moving forward. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2226 + // + // Empirical measurements show that if we rel

[PATCH] D114622: [clang-tidy][analyzer] Fix false-positive in IdenticalExprChecker and misc-redundant-expression

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D114622#3155605 , @whisperity wrote: > I haven't looked at the patch in detail yet, but I know I've run into the > issue this aims to fix when developing a Tidy check! > > There is a `// NOLINTNEXTLINE(misc-redundant-express

[PATCH] D114622: [clang-tidy][analyzer] Fix false-positive in IdenticalExprChecker and misc-redundant-expression

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 390023. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114622/new/ https://reviews.llvm.org/D114622 Files: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp c

[PATCH] D114622: [clang-tidy][analyzer] Fix false-positive in IdenticalExprChecker and misc-redundant-expression

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 390032. steakhal marked 3 inline comments as done. steakhal added a comment. Fixing nits: renaming variables, etc. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114622/new/ https://reviews.llvm.org/D114622 Files: clang-tools-extra/clang-tidy/bug

[PATCH] D114622: [clang-tidy][analyzer] Fix false-positive in IdenticalExprChecker and misc-redundant-expression

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp:54-55 const NestedNameSpecifier *Right) { - llvm::FoldingSetNodeID LeftID, RightID; - Left->Profile(LeftID); - Right->Profile(Righ

[PATCH] D113558: [clang-tidy] Fix cppcoreguidelines-virtual-base-class-destructor in macros

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D113558#3154967 , @whisperity wrote: > I'm not sure if it is a good idea to merge things on a Friday, but I am > comfortable with this, let's get the check crash less. I've run this on a few projects and it did not introduc

[PATCH] D114256: [clang-tidy] Fix crashing altera-struct-pack-align on invalid RecordDecls

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I plan to commit this stack on Monday. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114256/new/ https://reviews.llvm.org/D114256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[PATCH] D113753: [Analyzer][Core] Better simplification in SimpleSValBuilder::evalBinOpNN

2021-11-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D113753#3156270 , @bjope wrote: > This seem to cause some weird results. > > Given this input: > > bar(short k) { > k++; > for (short f = 0; f < k; f++) > ; > (long)k << 16; > } > > we get > > > clang

[PATCH] D113558: [clang-tidy] Fix cppcoreguidelines-virtual-base-class-destructor in macros

2021-11-29 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0685e83534ef: Fix cppcoreguidelines-virtual-base-class-destructor in macros (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113558/new

[PATCH] D114254: [libtooling][clang-tidy] Fix crashing on rendering invalid SourceRanges

2021-11-29 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0540485436c4: [libtooling][clang-tidy] Fix crashing on rendering invalid SourceRanges (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D114256: [clang-tidy] Fix crashing altera-struct-pack-align on invalid RecordDecls

2021-11-29 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe1d0673aeeec: [clang-tidy] Fix crashing altera-struct-pack-align on invalid RecordDecls (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

2021-11-29 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa8120a771143: [clang-tidy] Ignore narrowing conversions in case of bitfields (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/D114105?vs=389711&id=390275#toc Repository: rG L

[PATCH] D114441: [analyzer][NFC] Refactor AnalysisConsumer::getModeForDecl()

2021-11-29 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGaf37d4b6fee8: [analyzer][NFC] Refactor AnalysisConsumer::getModeForDecl() (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monore

[PATCH] D91000: [clang-tidy] Add cert-msc24-c checker.

2021-11-29 Thread Balázs Benics via Phabricator via cfe-commits
steakhal resigned from this revision. steakhal added a comment. I've already reviewed this change offline, thus I resign. For me this looks great, I'm eager to hear your opinions! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91000/new/ https://reviews.llvm.org/D91000

[PATCH] D114441: [analyzer][NFC] Refactor AnalysisConsumer::getModeForDecl()

2021-11-29 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:599-603 + const SourceLocation Loc = [&SM](Decl *D) -> SourceLocation { +const Stmt *Body = D->getBody(); +SourceLocation SL = Body ? Body->getBeginLoc() : D->getLocation()

[PATCH] D103317: [Analyzer][Core] Make SValBuilder to better simplify svals with 3 symbols in the tree

2021-11-29 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. Still looks great. Comment at: clang/test/Analysis/svalbuilder-simplify-compound-svals.cpp:75 + if (b * b == 1) +; // no-crash (assertion should not be viola

[PATCH] D114619: [Analyzer][solver] Do not remove the simplified symbol from the eq class

2021-11-29 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 think it looks great. Comment at: clang/test/Analysis/symbol-simplification-disequality-info.cpp:15-26 + // CHECK: "disequality_info": [ + // CHECK-NEXT: { +

[PATCH] D114706: [analyzer] Fix sensitive argument logic in GenericTaintChecker

2021-11-29 Thread Balázs Benics via Phabricator via cfe-commits
steakhal requested changes to this revision. steakhal added a comment. This revision now requires changes to proceed. E.g. `execl()` and `execlp` functions are actually variadic. You should also account for them. I would rather map directly to a full-fledged Propagation rule instead of to a sens

[PATCH] D102669: [analyzer][ctu] Fix wrong 'multiple definitions' errors caused by space characters in lookup names when parsing the ctu index file

2021-11-30 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Looks good. Please get rid of the macro stuff, consider something along the lines I proposed for the parsing stuff. Also clang-format the code you touch. I haven't checked the docs and the comments of the codebase, but I'll assume you grepped and fixed all occurrences.

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

2021-11-30 Thread Balázs Benics via Phabricator via cfe-commits
steakhal requested changes to this revision. steakhal added a comment. This revision now requires changes to proceed. In D112621#3160082 , @manas wrote: > I have made few changes: > > 1. The failed assertions due to >

[PATCH] D114454: [NFC][AIX]Disable unstable CSA tests failing on AIX

2021-12-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D114454#3162490 , @stevewan wrote: >> setting a bunch of target triples and letting gtest to run each one to see >> if it still passes on all triples. > > Did you mean adding all the triples that we're interested in to > `al

[PATCH] D114887: [Analyzer][solver] Simplification: Do a fixpoint iteration before the eq class merge

2021-12-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I think I'm in favor of this change. However, Im also slightly in favor of reverting stuff instead of rushing things. Let's hope it will resolve the issue of the previous offending commit. Accepted. Comment at: clang/lib/StaticAnalyzer/Core/RangeCon

[PATCH] D114887: [Analyzer][solver] Simplification: Do a fixpoint iteration before the eq class merge

2021-12-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Also, please provide the coverage of the new test case (only excercising the new test case not the whole test file) I really want to make sure that it will cover the loop as it supposed to. Oh, I just now see that there is no test. Now I'm really courious. Repository

[PATCH] D114938: [Analyzer] SValBuilder: Simlify a SymExpr to the absolute simplest form

2021-12-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I don't think there is any time concern with this patch. It's NFC. You should retitle accordingly. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:51 + // sub-trees and if a value is a constant we do the constant folding. + SVal simp

[PATCH] D114887: [Analyzer][solver] Simplification: Do a fixpoint iteration before the eq class merge

2021-12-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D114887#3165415 , @martong wrote: > In D114887#3165397 , @steakhal > wrote: > >> Also, please provide the coverage of the new test case (only excercising the >> new test case not the

[PATCH] D114454: [CSA]Skip unstable CSA tests failing on several platforms

2021-12-02 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 think it looks good. Sorry for the delay. I'll fix the test later, to pass on all targets :) Thanks again for making it support multiple triples. Repository: rG LLVM Github Monorepo C

[PATCH] D114454: [CSA]Skip unstable CSA tests failing on several platforms

2021-12-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Ah, please retitle this to have the [analyzer] tag. I think we dont use the CSA tag or any other. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114454/new/ https://reviews.llvm.org/D114454 ___

[PATCH] D113753: [Analyzer][Core] Better simplification in SimpleSValBuilder::evalBinOpNN

2021-12-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:372 QualType resultTy) { NonLoc InputLHS = lhs; NonLoc InputRHS = rhs; @martong, you simplified the operands, but you overwri

[PATCH] D113753: [Analyzer][Core] Better simplification in SimpleSValBuilder::evalBinOpNN

2021-12-03 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:372 QualType resultTy) { NonLoc InputLHS = lhs; NonLoc InputRHS = rhs; martong wrote: > steakhal wrote: > > @martong, you sim

[PATCH] D91000: [clang-tidy] Add cert-msc24-c checker.

2021-12-03 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. L129 and L135 are uncovered by tests. The rest of the lines are covered by tests, according to `lcov`. The checker produced in total 15 reports on these 18 projects: `memcached,tmux,curl,twin,vim,openssl,sqlite,ffmpeg,postgres,tinyxml2,libwebm,xerces,bitcoin,protobuf,qt

[PATCH] D102669: [analyzer][ctu] Fix wrong 'multiple definitions' errors caused by space characters in lookup names when parsing the ctu index file

2021-12-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/CrossTU/CrossTranslationUnit.cpp:154-172 + // Find the length delimiter. + const size_t LengthDelimiter = LineRef.find(':'); + if (StringRef::npos == LengthDelimiter) +return false; + + // Parse the length of LookupNam

[PATCH] D114510: [analyzer] Ignore flex generated files

2021-12-06 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9873ef409c4a: [analyzer] Ignore flex generated files (authored by steakhal). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D102669: [analyzer][ctu] Fix wrong 'multiple definitions' errors caused by space characters in lookup names when parsing the ctu index file

2021-12-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Please mark comments 'done' if they are done. Comment at: clang/lib/CrossTU/CrossTranslationUnit.cpp:154-172 + // Find the length delimiter. + const size_t LengthDelimiter = LineRef.find(':'); + if (StringRef::npos == LengthDelimiter) +return fa

[PATCH] D102669: [analyzer][ctu] Fix wrong 'multiple definitions' errors caused by space characters in lookup names when parsing the ctu index file

2021-12-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/CrossTU/CrossTranslationUnit.cpp:154-172 + // Find the length delimiter. + const size_t LengthDelimiter = LineRef.find(':'); + if (StringRef::npos == LengthDelimiter) +return false; + + // Parse the length of LookupNam

[PATCH] D136162: [analyzer] Fix assertion failure in RegionStore within bindArray()

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

[PATCH] D135136: [analyzer] Make directly bounded LazyCompoundVal as lazily copied

2022-10-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked 5 inline comments as done. steakhal added a comment. Thanks for the review @martong! I'll land this tomorrow. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135136/new/ https://reviews.llvm.org/D135136 __

[PATCH] D134947: [analyzer] Fix the liveness of Symbols for values in regions referred by LazyCompoundVal

2022-10-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. It seems like we are all aligned. I'll land this tomorrow. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134947/new/ https://reviews.llvm.org/D134947 ___ cfe-commits mailing lis

[PATCH] D136162: [analyzer] Fix assertion failure in RegionStore within bindArray()

2022-10-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D136162#3865081 , @martong wrote: > Hmm, seems like the conflicting prototype (i.e. the obsolescent use of zero > parameters) is needed to reproduce the assertion failure. That makes me > wonder, how does the redecl chain of

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 469234. steakhal retitled this revision from "[analyzer] Fix assertion failure in RegionStore within bindArray()" to "[analyzer] Fix assertion failure with conflicting prototype calls". steakhal edited the summary of this revision. steakhal added a comment.

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D136162#3869645 , @NoQ wrote: >> In this example, we try to store 42 to the Elem{buffer, 0}. > > In this case the natural question is, why does it go through `bindArray()`? > We're not binding an array. Can we try to preserve

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked an inline comment as done. steakhal added inline comments. Comment at: clang/test/Analysis/region-store.c:66 + // expected-warning@+1 {{passing arguments to 'b' without a prototype is deprecated in all versions of C and is not supported in C2x}} + b(&buffer); +

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked an inline comment as done. steakhal added a comment. In D136162#3873392 , @NoQ wrote: > Ok so you're saying that it's not just a wrong Decl but there's like an > entire cast-expression missing in the AST? This fix is probably good enough

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked 2 inline comments as done. steakhal added a comment. In D136162#3874953 , @martong wrote: > Thanks for the update. Nice Work! Thanks! I'll land this tomorrow. Comment at: clang/test/Analysis/region-store.c:66 + // exp

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-24 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked 2 inline comments as done. steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CallEvent.cpp:490 +// edge-cases. +ArgVal = castArgToParamTypeIfNeeded(Call, Idx, ArgVal, SVB); + steakhal wrote: > tomasz-kaminski-sonars

[PATCH] D136603: [analyzer] Model cast after LValueToRValueBitCasts

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

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-10-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D136671#3882166 , @isuckatcs wrote: >> This eliminate the crash in `getDynamicElementCount` on that region > > I think that if the crash comes from `getDynamicElementCount`, we should > address it there too, so > when the fu

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-26 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGaa12a48c8223: [analyzer] Fix assertion failure with conflicting prototype calls (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/D136162?vs=469234&id=470756#toc Repository: r

[PATCH] D136603: [analyzer] Model cast after LValueToRValueBitCasts

2022-10-27 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 471112. steakhal added a comment. Previously, even in the `RegionStoreManager::getBinding()` even if `T` was non-null, we replaced it with `TVR->getValueType()` in case the `MR` was `TypedValueRegion`. IMO we shouldn't overwrite the type unless we actually

[PATCH] D136603: [analyzer] Model cast after LValueToRValueBitCasts

2022-10-28 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/svalbuilder-float-cast.c:18-19 *p += 1; // This should NOT be (float)$x + 1. Symbol $x was never casted to float. - // FIXME: Ideally, this should be $x + 1. - clang_analyzer_express(*p); // expected-warning{

[PATCH] D131553: [analyzer] exploded-graph-rewriter: Fix python3 string encoding issues

2022-08-11 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 rG5e876c54f2d7: [analyzer] exploded-graph-rewriter: Fix python3 string encoding issues (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/

[PATCH] D131879: [clang][analyzer] Errno modeling code refactor (NFC).

2022-08-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. Approved with nits. Thanks! Comment at: clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.cpp:267 +const char *describeErrnoCheckState(errno_modeling::ErrnoCheckState CS)

[PATCH] D131707: [analyzer][NFC] Cache the result of getLocationType in TypedValueRegion

2022-08-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Please measure the performance implications/gains of this patch to justify this change. Preferably test it on multiple kinds of projects ranging from old-school C and even some modern C++ projects. Let me know your findings and if you need some help setting it up. ==

[PATCH] D131707: [analyzer][NFC] Cache the result of getLocationType in TypedValueRegion

2022-08-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a subscriber: balazske. steakhal added a comment. In D131707#3723403 , @ASDenysPetrov wrote: > @steakhal > Thank you for the review. > Could you please do testing for me, since I'm on Windows and have no prepared > testing environment as

<    3   4   5   6   7   8   9   10   11   12   >