[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -33,7 +33,66 @@ using namespace taint; using llvm::formatv; namespace { -enum OOB_Kind { OOB_Precedes, OOB_Exceeds, OOB_Taint }; +class StateUpdateReporter { + const SubRegion *Reg; + NonLoc ByteOffsetVal; + std::optional ElementType = std::nullopt; + std::optional

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -318,17 +396,87 @@ static Messages getTaintMsgs(const SubRegion *Region, const char *OffsetName) { RegName, OffsetName)}; } -void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext ) const { - // NOTE: Instead of using

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -255,7 +319,28 @@ static Messages getPrecedesMsgs(const SubRegion *Region, NonLoc Offset) { Out << "Access of " << RegName << " at negative byte offset"; if (auto ConcreteIdx = Offset.getAs()) Out << ' ' << ConcreteIdx->getValue(); - return

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -350,6 +498,10 @@ void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext ) const { auto [Reg, ByteOffset] = *RawOffset; + // The state updates will be reported as a single note tag, which will be + // composed by this helper class. +

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -33,7 +33,66 @@ using namespace taint; using llvm::formatv; namespace { -enum OOB_Kind { OOB_Precedes, OOB_Exceeds, OOB_Taint }; +class StateUpdateReporter { + const SubRegion *Reg; + NonLoc ByteOffsetVal; + std::optional ElementType = std::nullopt; + std::optional

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -33,7 +33,66 @@ using namespace taint; using llvm::formatv; namespace { -enum OOB_Kind { OOB_Precedes, OOB_Exceeds, OOB_Taint }; +class StateUpdateReporter { + const SubRegion *Reg; + NonLoc ByteOffsetVal; + std::optional ElementType = std::nullopt; + std::optional

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -318,17 +396,87 @@ static Messages getTaintMsgs(const SubRegion *Region, const char *OffsetName) { RegName, OffsetName)}; } -void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext ) const { - // NOTE: Instead of using

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,128 @@ +// RUN: %clang_analyze_cc1 -Wno-array-bounds -analyzer-output=text\ +// RUN: -analyzer-checker=core,alpha.security.ArrayBoundV2,unix.Malloc,alpha.security.taint,debug.ExprInspection -verify %s + +int array[10]; + +void

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -318,17 +396,87 @@ static Messages getTaintMsgs(const SubRegion *Region, const char *OffsetName) { RegName, OffsetName)}; } -void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext ) const { - // NOTE: Instead of using

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -133,12 +195,19 @@ computeOffset(ProgramStateRef State, SValBuilder , SVal Location) { return std::nullopt; } -// TODO: once the constraint manager is smart enough to handle non simplified -// symbolic expressions remove this function. Note that this can not be used in

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I only scrolled through the patch. But I find it pretty good. I still need to go over the message construction and the tests along with it, and also to look for more logic bugs. https://github.com/llvm/llvm-project/pull/78315

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
@@ -318,17 +396,87 @@ static Messages getTaintMsgs(const SubRegion *Region, const char *OffsetName) { RegName, OffsetName)}; } -void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext ) const { - // NOTE: Instead of using

[clang] [analyzer] Support interestingness in ArrayBoundV2 (PR #78315)

2024-01-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/78315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Demonstrate superfluous unsigned >= 0 assumption (PR #78442)

2024-01-19 Thread Balazs Benics via cfe-commits
steakhal wrote: I'd advise against introducing a separate file for this, but I'm okay with landing tests. Given this issue, I'd be interested to look at how difficult it is to actually fix it and commit the case along with the fix. Have you looked at potential solutions?

[clang] [clang-tools-extra] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (PR #71417)

2024-01-18 Thread Balazs Benics via cfe-commits
steakhal wrote: > Please let us know if this change is disruptive to you though, thanks! I'm not really well versed about c++ initialization, so I asked my collage @tomasz-kaminski-sonarsource, to double-check how `CXXNewExpr` initialization is done per standard. I'll try to summarize what we

[clang-tools-extra] [clang] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (PR #71417)

2024-01-17 Thread Balazs Benics via cfe-commits
steakhal wrote: The commit _"[clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (#71417)"_ https://github.com/llvm/llvm-project/commit/e929f0694aeb5f8cdbd2369db6189d28bb6fbcf3 appears to be a functional change, as it has a side effect on the following test code: ```diff diff

[clang] [clang][analyzer] Add missing stream related functions to StdCLibraryFunctionsChecker. (PR #76979)

2024-01-05 Thread Balazs Benics via cfe-commits
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= Message-ID: In-Reply-To: steakhal wrote: Why do we need to keep these two checkers in-sync? https://github.com/llvm/llvm-project/pull/76979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Add .clang-format-ignore for ignoring files (PR #76327)

2024-01-04 Thread Balazs Benics via cfe-commits
steakhal wrote: FYI commit 09308122c6c0fa9eb3d729a2b2909733cbbc2160 added [a test](https://github.com/llvm/llvm-project/commit/09308122c6c0fa9eb3d729a2b2909733cbbc2160#diff-acfc8d9d85320dbf5e181b8aebb248a91b1d321c8798bae3663b44b0c08213db) that does not pass on Windows (MSVC). An example

[clang] [clang][analyzer] Support 'fdopen' in the StreamChecker (PR #76776)

2024-01-03 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/76776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer][NFC] Improve release note (PR #76805)

2024-01-03 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/76805 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Improve 'errno' modeling of 'mkdtemp' (PR #76671)

2024-01-03 Thread Balazs Benics via cfe-commits
steakhal wrote: No release notes? https://github.com/llvm/llvm-project/pull/76671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Take small objects by value (PR #76688)

2024-01-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/76688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Take small objects by value (PR #76688)

2024-01-01 Thread Balazs Benics via cfe-commits
steakhal wrote: Pushed as 7619050cd7c3715f34c1d13ea048c092299037bb and 8ee3dfd74653e30f48dd9f49ba24f43547e6a549 respectively. https://github.com/llvm/llvm-project/pull/76688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 8ee3dfd - [analyzer][NFC] Take SVal and NonLoc by value

2024-01-01 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2024-01-01T22:00:32+01:00 New Revision: 8ee3dfd74653e30f48dd9f49ba24f43547e6a549 URL: https://github.com/llvm/llvm-project/commit/8ee3dfd74653e30f48dd9f49ba24f43547e6a549 DIFF: https://github.com/llvm/llvm-project/commit/8ee3dfd74653e30f48dd9f49ba24f43547e6a549.diff

[clang] 7619050 - [analyzer][NFC] Take StringRef by value

2024-01-01 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2024-01-01T22:00:32+01:00 New Revision: 7619050cd7c3715f34c1d13ea048c092299037bb URL: https://github.com/llvm/llvm-project/commit/7619050cd7c3715f34c1d13ea048c092299037bb DIFF: https://github.com/llvm/llvm-project/commit/7619050cd7c3715f34c1d13ea048c092299037bb.diff

[clang] [clang][analyzer] Improve 'errno' modeling of 'mkdtemp' (PR #76671)

2024-01-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/76671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Improve 'errno' modeling of 'mkdtemp' (PR #76671)

2024-01-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/76671 >From 0c586914ac977920140472d172ee357dea43f2c5 Mon Sep 17 00:00:00 2001 From: Ben Shi Date: Mon, 1 Jan 2024 18:48:27 +0800 Subject: [PATCH 1/2] [clang][analyzer] Improve 'errno' modeling of 'mkdtemp' ---

[lld] [llvm] [clang] [mlir] [libcxx] [flang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

2024-01-01 Thread Balazs Benics via cfe-commits
@@ -31,14 +31,14 @@ class InvalidatedIteratorChecker check::PreStmt, check::PreStmt> { - std::unique_ptr InvalidatedBugType; + const BugType InvalidatedBugType{this, "Iterator invalidated", + "Misuse of

[clang] [analyzer][NFC] Take small objects by value (PR #76688)

2024-01-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/76688 None >From 70c03932cad401f477674881050a8f0c4b573cdb Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Mon, 1 Jan 2024 18:59:46 +0100 Subject: [PATCH 1/2] [analyzer][NFC] Take StringRef by value ---

[flang] [lld] [mlir] [llvm] [libcxx] [clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

2024-01-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/76655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [lld] [mlir] [llvm] [libcxx] [clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

2024-01-01 Thread Balazs Benics via cfe-commits
@@ -52,10 +52,13 @@ class SimpleStreamChecker : public Checker { - CallDescription OpenFn, CloseFn; + const CallDescription OpenFn{{"fopen"}, 2}; + const CallDescription CloseFn{{"fclose"}, 1}; steakhal wrote: Here is why we can't have CallDescriptions

[flang] [lld] [mlir] [llvm] [libcxx] [clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

2024-01-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/76655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [lld] [mlir] [llvm] [libcxx] [clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

2024-01-01 Thread Balazs Benics via cfe-commits
@@ -52,10 +52,13 @@ class SimpleStreamChecker : public Checker { - CallDescription OpenFn, CloseFn; + const CallDescription OpenFn{{"fopen"}, 2}; + const CallDescription CloseFn{{"fclose"}, 1}; steakhal wrote: Well, it seems like `StringRef` is not constexpr

[clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

2024-01-01 Thread Balazs Benics via cfe-commits
@@ -17,19 +17,18 @@ #include "MPITypes.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" +#include "llvm/ADT/StringRef.h" namespace clang { namespace ento { namespace mpi { class MPIBugReporter { public: - MPIBugReporter(const CheckerBase ) { -

[clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

2024-01-01 Thread Balazs Benics via cfe-commits
@@ -31,14 +31,14 @@ class InvalidatedIteratorChecker check::PreStmt, check::PreStmt> { - std::unique_ptr InvalidatedBugType; + const BugType InvalidatedBugType{this, "Iterator invalidated", + "Misuse of

[clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

2023-12-31 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/76655 >From 0362ae2c888edc749711209174f592c5c311db76 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 31 Dec 2023 11:33:15 +0100 Subject: [PATCH 1/2] [analyzer][NFC] Cleanup BugType lazy-init patterns Cleanup

[clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

2023-12-31 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/76655 Cleanup most of the lazy-init `BugType` legacy. Some will be preserved, as those are slightly more complicated to refactor. Notice, that the default category for `BugType` is `LogicError`. I omitted setting

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-30 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,200 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/76580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. First batch of review. https://github.com/llvm/llvm-project/pull/76580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,201 @@ +//===- StdAnyChecker.cpp -*- C++ -*===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [analyzer] Add std::any checker (PR #76580)

2023-12-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/76580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Support 'fflush' in the StdLibraryFunctionsChecker (PR #76557)

2023-12-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/76557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clang] [analyzer] Trust base to derived casts for dynamic types (PR #69057)

2023-12-29 Thread Balazs Benics via cfe-commits
steakhal wrote: To illustrate the case of my previous argument, here are two examples: https://godbolt.org/z/5vWadfPM9 ```c++ // base.h BEGIN: class Base { public: virtual int fun() const = 0; }; class Derived1 final : public Base { public: int fun() const override { return 1; } }; //

[clang] [llvm] [clang-tools-extra] [analyzer] Trust base to derived casts for dynamic types (PR #69057)

2023-12-29 Thread Balazs Benics via cfe-commits
@@ -492,11 +492,13 @@ void check_required_cast() { void check_cast_behavior(OSObject *obj) { OSArray *arr1 = OSDynamicCast(OSArray, obj); - clang_analyzer_eval(arr1 == obj); // expected-warning{{TRUE}} -// expected-note@-1{{TRUE}} -

[clang] [llvm] [clang-tools-extra] [analyzer] Trust base to derived casts for dynamic types (PR #69057)

2023-12-29 Thread Balazs Benics via cfe-commits
steakhal wrote: > Thanks for the replies. I'll come back to this PR once I have some time; > maybe during the holidays. Both assertions directly relate to this PR for > sure. I think I've just fixed the reported crash for this PR. For some reason a `CastExpr` does not have a reference type

[clang] [llvm] [clang-tools-extra] [analyzer] Trust base to derived casts for dynamic types (PR #69057)

2023-12-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/69057 >From 8ed4effd114ebd83d4ceaa37655ffd9b7105b28e Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sat, 14 Oct 2023 15:51:42 +0200 Subject: [PATCH 1/5] [analyzer] Trust base to derived casts for dynamic types

[clang] [clang][analyzer] Support 'fflush' in the StdLibraryFunctionsChecker (PR #76557)

2023-12-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/76557 >From 2eebb462b8a7865684d3baaffbad7560eed10e57 Mon Sep 17 00:00:00 2001 From: Ben Shi Date: Fri, 29 Dec 2023 16:44:47 +0800 Subject: [PATCH 1/2] [clang][analyzer] Support 'fflush' in the

[clang] [clang][analyzer] Support 'fflush' in the StdLibraryFunctionsChecker (PR #76557)

2023-12-29 Thread Balazs Benics via cfe-commits
steakhal wrote: please also update the release notes https://github.com/llvm/llvm-project/pull/76557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
=?utf-8?q?G=C3=A1bor?= Spaits,=?utf-8?q?G=C3=A1bor?= Spaits, =?utf-8?q?G=C3=A1bor?= Spaits,Balazs Benics Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. LGTM now. Thanks. https://github.com/llvm/llvm-project/pull/76501

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
=?utf-8?q?Gábor?= Spaits,=?utf-8?q?Gábor?= Spaits, =?utf-8?q?Gábor?= Spaits,Balazs Benics Message-ID: In-Reply-To: https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/76501 >From b271420a6e4ed23abf2749d767f986aa16d9fe9d Mon Sep 17 00:00:00 2001 From: Gabor Spaits

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
=?utf-8?q?G=C3=A1bor?= Spaits,=?utf-8?q?G=C3=A1bor?= Spaits, =?utf-8?q?G=C3=A1bor?= Spaits Message-ID: In-Reply-To: steakhal wrote: let me check it again https://github.com/llvm/llvm-project/pull/76501 ___ cfe-commits mailing list

[clang] [analyzer][solver] On SymSym RelOps, check EQClass members for contradictions (PR #71284)

2023-12-28 Thread Balazs Benics via cfe-commits
steakhal wrote: > I'm not opposed to landing this PR in llvm-18 (we have it, and it improves > the user experience), but I wouldn't like to have it in llvm-19 and later. To clarify my intentions, I wanted to land this as it resolves user complaints (as fixing an open issue), at a likely

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
@@ -2097,6 +2097,21 @@ This checker is a part of ``core.StackAddressEscape``, but is temporarily disabl .. _alpha-core-TestAfterDivZero: +alpha.core.StdVariant (C++) +""" +Check if a value of active type is retrieved from an ``std::variant`` instance

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
@@ -2097,6 +2097,21 @@ This checker is a part of ``core.StackAddressEscape``, but is temporarily disabl .. _alpha-core-TestAfterDivZero: +alpha.core.StdVariant (C++) +""" +Check if a value of active type is retrieved from an ``std::variant`` instance

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
@@ -2097,6 +2097,18 @@ This checker is a part of ``core.StackAddressEscape``, but is temporarily disabl .. _alpha-core-TestAfterDivZero: +alpha.core.StdVariant (C++) +""" +Check if the active value accessed in an ``std::variant`` instance. +..

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. https://github.com/llvm/llvm-project/pull/76501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
@@ -2097,6 +2097,21 @@ This checker is a part of ``core.StackAddressEscape``, but is temporarily disabl .. _alpha-core-TestAfterDivZero: +alpha.core.StdVariant (C++) +""" +Check if a value of active type is retrieved from an ``std::variant`` instance

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/76501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add documentation for std::variant checker (PR #76501)

2023-12-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Please also update the release notes with a link as documentation. Follow the existing patterns there. https://github.com/llvm/llvm-project/pull/76501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Fix "sprintf" parameter modeling in CStringChecker (PR #74345)

2023-12-28 Thread Balazs Benics via cfe-commits
steakhal wrote: Manually merged as: - d1856b2f18c412f8ffbeee30e6e0316c197c143c - a49cf6c14ad498244fee6026da59cfdcdad6b80c https://github.com/llvm/llvm-project/pull/74345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Fix "sprintf" parameter modeling in CStringChecker (PR #74345)

2023-12-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/74345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix "sprintf" parameter modeling in CStringChecker (PR #74345)

2023-12-28 Thread Balazs Benics via cfe-commits
@@ -1,13 +1,15 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -verify %s - -// expected-no-diagnostics +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix,debug.ExprInspection -verify %s // Test functions that are called "memcpy" but aren't the memcpy //

[clang] a49cf6c - [analyzer] Fix "sprintf" parameter modeling in CStringChecker

2023-12-28 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2023-12-28T16:06:21+01:00 New Revision: a49cf6c14ad498244fee6026da59cfdcdad6b80c URL: https://github.com/llvm/llvm-project/commit/a49cf6c14ad498244fee6026da59cfdcdad6b80c DIFF: https://github.com/llvm/llvm-project/commit/a49cf6c14ad498244fee6026da59cfdcdad6b80c.diff

[clang] d1856b2 - [analyzer][NFC] Prefer CallEvent over CallExpr in APIs

2023-12-28 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2023-12-28T15:55:33+01:00 New Revision: d1856b2f18c412f8ffbeee30e6e0316c197c143c URL: https://github.com/llvm/llvm-project/commit/d1856b2f18c412f8ffbeee30e6e0316c197c143c DIFF: https://github.com/llvm/llvm-project/commit/d1856b2f18c412f8ffbeee30e6e0316c197c143c.diff

[clang] [analyzer][solver] On SymSym RelOps, check EQClass members for contradictions (PR #71284)

2023-12-28 Thread Balazs Benics via cfe-commits
steakhal wrote: Any objections for landing this PR? Or should we postpone this for llvm-19? https://github.com/llvm/llvm-project/pull/71284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[libc] [mlir] [llvm] [clang] [compiler-rt] [openmp] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/76446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[openmp] [libc] [clang] [mlir] [llvm] [compiler-rt] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
steakhal wrote: Introduced subsub-sections and ordered them and their content by expected relevance. The rule of thumb was: - released stuff comes first, then alpha. etc. Also, checkers are always fully named, and named by their user-facing names. Now the html looks like this:

[openmp] [libc] [clang] [mlir] [llvm] [compiler-rt] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/76446 >From a4a8704644067a7cf81bee601e4898bbc6b9d289 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Wed, 27 Dec 2023 14:13:08 +0100 Subject: [PATCH 1/9] [analyzer][docs] Update the release notes for llvm-18 ---

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
steakhal wrote: I've decided to fix the checker docs for the `security.insecureAPI.DeprecatedOrUnsafeBufferHandling`. It turned out to be an easy one as the only missing function was `fprintf`, so it was already well in sync. I bundled that single word change with this PR for simplicity.

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/76446 >From a4a8704644067a7cf81bee601e4898bbc6b9d289 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Wed, 27 Dec 2023 14:13:08 +0100 Subject: [PATCH 1/5] [analyzer][docs] Update the release notes for llvm-18 ---

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/76446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
steakhal wrote: @spaits Could you craft some docs for the experimental std::variant checker? https://github.com/llvm/llvm-project/pull/76446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
steakhal wrote: ![image](https://github.com/llvm/llvm-project/assets/6280485/ca01806a-2983-4940-9b99-48da9c50449c) https://github.com/llvm/llvm-project/pull/76446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
@@ -1052,18 +1052,92 @@ libclang Static Analyzer --- +- Implemented the ``[[clang::suppress]]`` attribute for suppressing diagnostics + of static analysis tools, such as the Clang Static Analyzer. + `Documentation

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/76446 >From a4a8704644067a7cf81bee601e4898bbc6b9d289 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Wed, 27 Dec 2023 14:13:08 +0100 Subject: [PATCH 1/4] [analyzer][docs] Update the release notes for llvm-18 ---

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-28 Thread Balazs Benics via cfe-commits
@@ -1072,16 +1146,36 @@ Static Analyzer Read the PR for the details. (`#66086 `_) +- Other taint-related improvements. + (`#66358 `_, + `#66074

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-27 Thread Balazs Benics via cfe-commits
steakhal wrote: The `docs-clang-html` build target produces the following html document at `tools/clang/docs/html/ReleaseNotes.html#static-analyzer`, without any warnings: ![image](https://github.com/llvm/llvm-project/assets/6280485/3c90c648-ba56-476d-8ba2-0e1d2ba8402a)

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/76446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/76446 This PR prepares the release notes of the Clang Static Analyzer for the llvm-18 release branch, due in about a week. See the regular [release

[clang] [analyzer][docs] Update the release notes for llvm-18 (PR #76446)

2023-12-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal milestoned https://github.com/llvm/llvm-project/pull/76446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Trust base to derived casts for dynamic types (PR #69057)

2023-12-13 Thread Balazs Benics via cfe-commits
steakhal wrote: Thanks for the replies. I'll come back to this PR once I have some time; maybe during the holidays. Both assertions directly relate to this PR for sure. > I looked into Tom's bug report and I hit the following assertion in a debug > build: > > ``` > clang: >

[clang] [Analyzer][NFC] Remove redundant function call (PR #75076)

2023-12-11 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I would agree with @isuckatcs, and I'd be weak against this PR. Right now I don't see the benefit of asserting this. Consider downstream users that might use this reporting system and have their own trackers. (We don't at Sonar, but pretend), then they

[clang] [analyzer] Move alpha checker EnumCastOutOfRange to optin (PR #67157)

2023-12-05 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: steakhal wrote: > (Force pushed the branch because I wanted to rebase it onto a recent main and > fix the merge conflicts. Is there a better workflow than this?) I think git also offers conflict resolution for `git merge origin/main`. It

[clang] [analyzer] Let the checkers query upper and lower bounds on symbols (PR #74141)

2023-12-05 Thread Balazs Benics via cfe-commits
steakhal wrote: My take is that the z3-based solver is crashing all over the place. So its not just slower. We anyways don't have CI checks for it. Given all these, I'd rather not put more burden to the issue tracker regarding this. I'd consider it if these issues wouldn't be present though,

[clang] [analyzer] Fix "sprintf" parameter modeling in CStringChecker (PR #74345)

2023-12-04 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/74345 Review the commits one by one. I plan to merge them manually by pushing both of these at once. This PR intends to fix #74269. >From 1359a7ef528358cc7e10a751aa885c6bd8ac8d1c Mon Sep 17 00:00:00 2001 From:

[clang] [analyzer] Switch to PostStmt callbacks in ArrayBoundV2 (PR #72107)

2023-12-04 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -413,6 +464,19 @@ bool ArrayBoundCheckerV2::isFromCtypeMacro(const Stmt *S, ASTContext ) {

[clang] [analyzer] Switch to PostStmt callbacks in ArrayBoundV2 (PR #72107)

2023-12-04 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. Sorry for reporting back only after a week or so. The analysis

[clang] [analyzer] Switch to PostStmt callbacks in ArrayBoundV2 (PR #72107)

2023-12-04 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/72107

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