[PATCH] D130709: MSVC compatibility mode: fix error on unqualified templated base class initialization in case of partial specialization

2022-08-16 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGba1c396e09a6: MSVC compatibility mode: fix error on unqualified templated base class… (authored by frederic-tingaud-sonarsource, committed by steakhal). Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D132017: [clang][analyzer] Add errno modeling to StreamChecker

2022-08-17 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:283-284 + mutable bool EofInitialized = false; + mutable int EofVal = -1; + Have you considered using `llvm::Optional` for this? Comment at: cla

[PATCH] D132109: [analyzer] Dump the environment entry kind as well

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

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

2022-08-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. It feels like there is no objection. I think it looks great and you did everything you could to address the review comments. I believe we should not postpone this any further. Consider comm

[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

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

[PATCH] D132143: [analyzer] LazyCompoundVals should be always bound as default bindings

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

[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

2022-08-18 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D132142#3733629 , @NoQ wrote: > Like I vaguely mentioned in the thread, I'm really curious whether it's > possible to canonicalize the *absence* of element regions instead, as it > allows modeling pointer casts as no-op and

[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

2022-08-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/trivial-copy-struct.cpp:26 + + clang_analyzer_dump(n1); // expected-warning {{&SymRegion{reg_$2}}} + clang_analyzer_dump(n2); // expected-warning {{&HeapSymRegion{conj_$1{Node *, LC1, S1855, #1 ---

[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

2022-08-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 454009. steakhal added a comment. - Use `:digit:` regex matching in the tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132142/new/ https://reviews.llvm.org/D132142 Files: clang/include/clang/StaticAna

[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

2022-08-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:791-793 + /// TODO: Ellaborate why this is not a typed region, and why this is just an + /// 'approximation'. + QualType getApproximatedType() const { ---

[PATCH] D132143: [analyzer] LazyCompoundVals should be always bound as default bindings

2022-08-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 454010. steakhal added a comment. - Rebase for using `:digit:` regex matching in the tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132143/new/ https://reviews.llvm.org/D132143 Files: clang/lib/Static

[PATCH] D132236: [analyzer] Fix liveness of LazyCompoundVals

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

[PATCH] D132289: [analyzer] Drop deprecated flags

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

[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

2022-08-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 454857. steakhal added a comment. - Simplify `getApproximatedType()` to `return sym->getType()->getPointeeType();` - Add doc comments to `getApproximatedType()` - Removed the "Copied from RegionStoreManager::bind()" FIXME from the `ExprEngine::VisitMemberExp

[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

2022-08-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 454859. steakhal added a comment. upload the same with context Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132142/new/ https://reviews.llvm.org/D132142 Files: clang/include/clang/StaticAnalyzer/Checkers/S

[PATCH] D132236: [analyzer] Fix liveness of LazyCompoundVals

2022-08-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 454861. steakhal added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132236/new/ https://reviews.llvm.org/D132236 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp clang/test/Analysis

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

2022-08-23 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG16cb3be62600: [analyzer] Deadstore static analysis: Fix false positive on C++17 assignments (authored by frederic-tingaud-sonarsource, committed by steakhal). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D132289: [analyzer] Drop deprecated flags

2022-08-23 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6ca17b58f569: [analyzer] Drop deprecated flags (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132289/new/ https://reviews.llvm.org/D1

[PATCH] D127973: [analyzer] Eval construction of non POD type arrays.

2022-08-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. @isuckatcs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127973/new/ https://reviews.llvm.org/D127973 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[PATCH] D127973: [analyzer] Eval construction of non POD type arrays.

2022-08-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. This patch broke the `exploded-graph-rewriter`. It prints this stack-trace, when I'm using the b032e3ff6121a969b2e90ad7bf493c2d5d7ac3a2 . The issue is still present at main. Traceback (most recent

[PATCH] D127973: [analyzer] Eval construction of non POD type arrays.

2022-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127973#3749153 , @isuckatcs wrote: > @steakhal > > Can you send me a snippet please, which reproduces this issue? For me the > egraph rewriter works fine. I had the time for reducing it. Luckily it wasn't that bad. digra

[PATCH] D127973: [analyzer] Eval construction of non POD type arrays.

2022-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127973#3751119 , @isuckatcs wrote: >> I had the time for reducing it. Luckily it wasn't that bad. > > This egraph doesn't contain an entry with key "index_of_element", which is > strange. > > I still feel like I need a code

[PATCH] D132236: [analyzer] Fix liveness of LazyCompoundVals

2022-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D132236#3747652 , @NoQ wrote: > Nice catch but I don't think this is the right solution. > > Symbol liveness corresponds to a concrete runtime property of the program: > can the program obtain this value by executing further

[PATCH] D132236: [analyzer] Fix liveness of LazyCompoundVals

2022-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal planned changes to this revision. steakhal added a comment. In D132236#3752209 , @NoQ wrote: >> So, what you are suggesting here is an alternative solution to the one you >> already proposed in your last comment? > > I was just expanding the ini

[PATCH] D129280: [analyzer] PlacementNewChecker, properly handle array overhead (cookie)

2022-08-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp:157 "Storage provided to placement new is only {0} bytes, " -"whereas the allocated array type requires more space for " -"internal needs", -

[PATCH] D133119: [clang-tidy] Add checker 'bugprone-suspicious-realloc-usage'.

2022-09-29 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. LGTM, no objection here. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/suspicious-realloc-usage.cpp:81-85 +void warn_if_copy_exists(void *p) { + void *q = p; + p = realloc(p, 111); + // CHECK-MESSA

[PATCH] D132236: [analyzer] Fix liveness of LazyCompoundVals

2022-09-30 Thread Balázs Benics via Phabricator via cfe-commits
steakhal abandoned this revision. steakhal added a comment. I'm abandoning this change in favor of D134947 . I'll leave the patch summary and the discussion here for the history. --- In D132236#3753238 , @NoQ wrote: >>

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

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

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

2022-10-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. First of all, thanks for the feedback! In D134947#3830995 , @xazax.hun wrote: > If we end up going with this approach, I wonder if it would be a great time > to update some of the docs here: > https://clang.llvm.org/docs/analy

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

2022-10-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:2290 List.insert(List.end(), InnerList.begin(), InnerList.end()); - continue; } Here is the `continue` which previously prevented `getInterestingValues()`

[PATCH] D135107: [clang][NFC] Use enum for -fstrict-flex-arrays

2022-10-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. The StaticAnalyzer changes seem to be correct. Comment at: clang/include/clang/Basic/LangOptions.h:369-376 +/// Any trailing array memeber is a FAM. +Default = 0, +/// Any trailing array member of undefined, 0, or 1 size is a FAM. +OneZ

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

2022-10-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/trivial-copy-struct.cpp:58 + clang_analyzer_warnIfReached(); // no-warning: Dead code. +}; + Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134947/ne

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

2022-10-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 464961. steakhal added a comment. rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135136/new/ https://reviews.llvm.org/D135136 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp clang/test/Analysi

[PATCH] D135375: [analyzer] Initialize regions returned by CXXNew to undefined

2022-10-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Awesome! Have you measured how often would this change introduce new garbage value warnings? At the other side of the spectrum it could also hide reports, because it sinks the path too soon due to the falsely binding uninitialized value there. WDYT?

[PATCH] D135682: Fix false positive related to handling of [[noreturn]] function pointers

2022-10-11 Thread Balázs Benics via Phabricator via cfe-commits
steakhal resigned from this revision. steakhal added a comment. Herald added a subscriber: steakhal. I already reviewed this downstream. I'll let someone else approve this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135682/new/ https://reviews.l

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

2022-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. What do you think @NoQ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134947/new/ https://reviews.llvm.org/D134947 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[PATCH] D135763: [analyzer] Workaround crash on encountering Class non-type template parameters

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

[PATCH] D135682: Fix false positive related to handling of [[noreturn]] function pointers

2022-10-12 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 rGec6da3fb9d8c: Fix false positive related to handling of [[noreturn]] function pointers (authored by arseniy-sonar, committed by steakhal). Changed

[PATCH] D135763: [analyzer] Workaround crash on encountering Class non-type template parameters

2022-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D135763#3853746 , @xazax.hun wrote: > This change look good to me. I am not entirely sure about the future plans > though. Me neither. That was just a thought. > We should be able to read the values out from the AST, so we

[PATCH] D135763: [analyzer] Workaround crash on encountering Class non-type template parameters

2022-10-12 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb062ee7dc451: [analyzer] Workaround crash on encountering Class non-type template parameters (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/D135763?vs=467087&id=467366#toc Re

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

2022-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135136/new/ https://reviews.llvm.org/D135136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D131944: [analyzer] Remove pattern matching of lambda capture initializers

2022-10-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/lambdas.cpp:226 + [uniquePtr = MakeUniquePtr()] {}(); + clang_analyzer_warnIfReached(); // expected-warning{{TRUE}} +} It should have said `REACHABLE`. How does this pass? @isuckatcs Repository:

[PATCH] D140086: [analyzer][solver] Improve reasoning for not equal to operator

2022-12-17 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. About spellings. In the summary you used 'lesser', I think as a synonym for 'smaller' or something like that. Anyway, not important. Great stuff. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1642 +if (LHS.isUnsigned() != RH

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

2022-12-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D112621#4004372 , @uabelho wrote: > Hi, > > The following starts crashing with this patch: > > clang -cc1 -analyze -analyzer-checker=core bbi-77010.c > > It crashes with > > bbi-77010.c:6:1: warning: non-void function does

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

2022-12-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D112621#4004409 , @steakhal wrote: > In D112621#4004372 , @uabelho wrote: > >> Hi, >> >> The following starts crashing with this patch: >> >> clang -cc1 -analyze -analyzer-checker=co

[PATCH] D140086: [analyzer][solver] Improve reasoning for not equal to operator

2022-12-21 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. >>> Bitwidth was important because we should ideally cast smaller bitwidth type >>> to bigger bitwidth type. >>> Consider if we have LHS(u8), RHS(i32), then without checking for b

[PATCH] D139534: [analyzer] Don't escape local static memregions on bind

2022-12-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Finally, I had some time to come back to this. Thanks for taking the time for such a detailed response, kudos! @NoQ In D139534#3999455 , @NoQ wrote: > Ok screw it, my static example is still broken. There's technically still a

[PATCH] D139534: [analyzer] Don't escape local static memregions on bind

2022-12-21 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 484600. steakhal added a comment. - Add two test cases demonstrating the false-positives this patch will introduce. These are semantically equivalent to the one mentioned in the comments by @NoQ. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D139534: [analyzer] Don't escape local static memregions on bind

2023-01-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Let me know if you have further concerns. @xazax.hun @NoQ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139534/new/ https://reviews.llvm.org/D139534 ___ cfe-commits mailing list

[PATCH] D139534: [analyzer] Don't escape local static memregions on bind

2023-01-05 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D139534#4029097 , @xazax.hun wrote: > Sorry, I got a bit swamped, will try to take a look next week. In the > meantime, did you have a chance to run this over some open source projects? > Did you find any interesting diffs?

[PATCH] D139534: [analyzer] Don't escape local static memregions on bind

2023-01-09 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D139534#4034719 , @xazax.hun wrote: >> Here is the gist of one *new* TP: > > Where would `sprops` get escaped? Did I miss that or was that reduced out of > the example? You are right, it 'never' escapes, yet in the past we m

[PATCH] D140086: [analyzer][solver] Improve reasoning for not equal to operator

2023-01-09 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Sorry, I don't have the time this week. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140086/new/ https://reviews.llvm.org/D140086 ___ cfe-commits mailing list cfe-commits@lists

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

2022-11-07 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136603/new/ https://reviews.llvm.org/D136603 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

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

2022-11-09 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. This 'new' approach with the type auto-detection behaves the same way as the originally proposed patch. Same results, still no crashes :) I'll update the summary and the title according to the new approach. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D134791: [clang] Unify Sema and CodeGen implementation of isFlexibleArrayMemberExpr

2022-11-10 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I wonder if we could come up with an overload or something for cases when we only have a `FieldDecl`. For example, in the Clang Static Analyzer, we have something similar at MemRegion.cpp#L784-L811

[PATCH] D138037: [analyzer] Remove unjustified assertion from EQClass::simplify

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

[PATCH] D138037: [analyzer] Remove unjustified assertion from EQClass::simplify

2022-11-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 475480. steakhal added a comment. Add test case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138037/new/ https://reviews.llvm.org/D138037 Files: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp

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

2022-11-17 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Herald added a project: All. I did some extensive measurements of this option. According to my results, we could confidently enable this option by default; but still, keep the flag for backward compatibility and enable the users to opt-out. The benefit of enabling this

[PATCH] D142439: Fix C++11 warnings in RangeSetTest.cpp

2023-01-24 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'm not that confident around gtest macros, but this doesn't look harmful. Thanks for taking the time and fixing it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D140086: [analyzer][solver] Improve reasoning for not equal to operator

2023-01-24 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. Looks good. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140086/new/ https://reviews.llvm.org/D140086

[PATCH] D142454: [analyzer] Update satest dependencies

2023-01-24 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'm not using this docker file, so I don't mind changing it. It probably won't hurt :D Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142454/n

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I would be interested in some of the free-functions dealing with variants, such as `std::visit()`. https://godbolt.org/z/bbocrz4dG I hope that's also on the radar. In D142354#4079643 , @Szelethus wrote: > In D142354#4078450

[PATCH] D142627: [analyzer] Fix crash exposed by D140059

2023-01-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. I would not mind less artificial-looking test code, but I'll let you decide if you want to make action about it. Have you thought about the rest of the callsites of `getBitWidth()`? Are th

[PATCH] D138713: Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location." in ReturnPtrRange checker on builtin functions

2023-01-26 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG98d55095d851: Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location."… (authored by arseniy-sonar, committed by steakhal). Changed prior to commit: https://reviews.llvm.org/D13871

[PATCH] D140891: [analyzer] Fix assertion failure in SMT conversion for unary operator on floats.

2023-01-26 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 rG3674421c4bc0: [analyzer] Fix assertion failure in SMT conversion for unary operator on floats (authored by tomasz-kaminski-sonarsource, committed by

[PATCH] D142607: [clang][ASTImporter] Handle UsingType in friend declarations.

2023-01-27 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 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142607/new/ https://reviews.llvm.org/D142607 ___

[PATCH] D139534: [analyzer] Don't escape local static memregions on bind

2023-01-12 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG840edd8ab262: [analyzer] Don't escape local static memregions on bind (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/D139534?vs=484600&id=488546#toc Repository: rG LLVM Git

[PATCH] D142354: [analyzer] Create a stub for an std::variant checker

2023-01-23 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I'm very much interrested. I think you should define a mock standard variant header, that you could include from your tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142354/new/ https://reviews.llvm.org/D142354

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

2022-06-11 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 436124. steakhal added a comment. - Add the new `diag::warn_analyzer_deprecated_option` warning to the `"deprecated-static-analyzer-flag"` `DiagGroup` to prevent breaking the `clang/test/Misc/warning-flags.c` test file. I'm also adding @thakis to review th

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

2022-06-13 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/MemRegion.cpp:978 +assert(!Ty.isNull()); +if (Ty.isConstQualified() && Ty->isArithmeticType()) { // TODO: We could walk the complex types here and see if everything is xazax.

[PATCH] D127486: [analyzer][NFC] Inline AnalyzerOptions::getUserMode()

2022-06-13 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h:362-364 - /// Retrieves and sets the UserMode. This is a high-level option, - /// which is used to set other low-level options. It is not accessible - /// outside of AnalyzerO

[PATCH] D127485: [analyzer][NFC] Remove unused Analyses enum

2022-06-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 rG0539b456b788: [analyzer][NFC] Remove unused Analyses enum (authored by steakhal). Changed prior to commit: https://reviews.llvm.org/D127485?vs=435

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

2022-06-14 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 rGffe7950ebc62: Reland "[analyzer] Deprecate `-analyzer-store region

[PATCH] D127649: [analyzer][NFC][test] Add new RUN line with support-symbolic-integer-casts=true to expr-inspection.cpp

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/expr-inspection.cpp:11-13 void clang_analyzer_denote(int x, const char *str); +void clang_analyzer_denote(unsigned x, const char *str); void clang_analyzer_express(int x); Repository: rG LLVM

[PATCH] D127646: [analyzer][NFC][test] Add new RUN lint with support-symbolic-integer-casts=true to svalbuilder-rearrange-comparisons.c

2022-06-14 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/test/Analysis/svalbuilder-rearrange-comparisons.cpp:16-17 + +template +void clang_analyzer_eval(T x); +template Repository:

[PATCH] D127486: [analyzer][NFC] Inline AnalyzerOptions::getUserMode()

2022-06-14 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 rG24bd47dc172f: [analyzer][NFC] Inline AnalyzerOptions::getUserMode() (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

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

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 436707. steakhal marked an inline comment as done. steakhal added a comment. - Modify the `GenericTaintChecker::isStdin()` to look through //derived symbols//, to mitigate the effect of invalidations. Repository: rG LLVM Github Monorepo CHANGES SINCE LA

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

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal requested review of this revision. steakhal added a comment. Please check this again @martong @xazax.hun. I'll also conduct a measurement, investigating what report changes we experience with this change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D127732: [analyzer][NFC] Remove unused ExprEngine::evalBinOp functions

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added a reviewer: 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. steakhal

[PATCH] D126127: [analyzer][NFC] Relocate unary transfer functions

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 436725. steakhal added a comment. rebase; ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126127/new/ https://reviews.llvm.org/D126127 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBui

[PATCH] D127734: [analyzer][NFC] Substitute the SVal::evalMinus and evalComplement functions

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added a reviewer: 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. steakhal

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

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. ping again; @whisperity 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] D125709: [analyzer][Casting] Support isa, cast, dyn_cast of SVals

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGde6ba9704d0b: [analyzer][Casting] Support isa, cast, dyn_cast of SVals (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125709/new/ htt

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

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: martong, NoQ. 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] D125749: [analyzer][NFC] Introduce SVal::isa

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal abandoned this revision. steakhal added a comment. We don't have the consensus to make me confident in landing this change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125749/new/ https://reviews.llvm.org/D125749 ___

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

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal updated this revision to Diff 436821. steakhal marked an inline comment as done. steakhal added a comment. Use `getOriginRegion()`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127306/new/ https://reviews.llvm.org/D127306 Files: clang/

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

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127306#3581814 , @martong wrote: > In D127306#3580981 , @steakhal > wrote: > >> - Modify the `GenericTaintChecker::isStdin()` to look through //derived >> symbols//, to mitigate the

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

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

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

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127742#3581874 , @martong wrote: > Why not replace all `getAs`? That's a massive change. I actually experimented with it and I see no advantage with that. > I suppose you picked conditions because `isa` can have variadic p

[PATCH] D127732: [analyzer][NFC] Remove unused ExprEngine::evalBinOp functions

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D127732#3581883 , @martong wrote: > LGTM > > Do we have a tool to automatically discover unused member functions? (There > might be so many of them in CSA...) I don't :( The closest I found on the web is this: https://gith

[PATCH] D126127: [analyzer][NFC] Relocate unary transfer functions

2022-06-14 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 rGcfc915149c98: [analyzer][NFC] Relocate unary transfer functions (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D127734: [analyzer][NFC] Substitute the SVal::evalMinus and evalComplement functions

2022-06-14 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 rG40940fb2a63d: [analyzer][NFC] Substitute the SVal::evalMinus and evalComplement functions (authored by steakhal). Repository: rG LLVM Github Monor

[PATCH] D127732: [analyzer][NFC] Remove unused ExprEngine::evalBinOp functions

2022-06-14 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 rGcf078adc90f0: [analyzer][NFC] Remove unused ExprEngine::evalBinOp functions (authored by steakhal). Repository: rG LLVM Github Monorepo CHANGES S

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

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal marked 3 inline comments as done. steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/MemRegion.cpp:978 +assert(!Ty.isNull()); +if (Ty.isConstQualified() && Ty->isArithmeticType()) { // TODO: We could walk the complex types here and s

[PATCH] D125340: [clang][NFC][AST] rename the ImportError to ASTImportError

2022-06-14 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Conflict markers fixed by 6ccc2733e72017999a94c10147a71ff595286080 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125340/new/ https://reviews.llvm.org/

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

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

[PATCH] D127799: [StaticAnalyzer] Remove dead code (DO NOT COMMIT)

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Thanks @kazu. I evaluated your results and made a patch as D127836 . I think we can abandon this one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127799/new/ https://reviews.llvm.org/D1

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

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: kazu, 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. stea

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

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal created this revision. steakhal added reviewers: kazu, martong, balazske. 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:

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

2022-06-15 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I believe `evalAssume` would be a better fit for diagnosing such issues, but I can see your point that we don't have `CheckerContext` there to emit reports. That being said, the `check::Location` is the best alternative. Please also check the not `done` comments. ===

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