[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-08 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/152137 From 5ab97a764d9972b921016687f413972901491941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Tue, 5 Aug 2025 15:35:32 +0200 Subject: [PATCH 1/6] [clang][analyzer][NFCi] Pass if bind i

[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-08 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/152137 From 5ab97a764d9972b921016687f413972901491941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Tue, 5 Aug 2025 15:35:32 +0200 Subject: [PATCH 1/6] [clang][analyzer][NFCi] Pass if bind i

[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-08 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/152137 From 5ab97a764d9972b921016687f413972901491941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Tue, 5 Aug 2025 15:35:32 +0200 Subject: [PATCH 1/5] [clang][analyzer][NFCi] Pass if bind i

[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-07 Thread Endre Fülöp via cfe-commits
gamesh411 wrote: I have stumbled upon a possible inconsistency in the way performTrivialCopy in ExprEngineCXX calls evalBind (by extending the test case to see this new flag as well). With the above proposed fix, I think it may no longer be NFC technically. Please feel free to remove the tag i

[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-07 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/152137 From 5ab97a764d9972b921016687f413972901491941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Tue, 5 Aug 2025 15:35:32 +0200 Subject: [PATCH 1/4] [clang][analyzer][NFCi] Pass if bind i

[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-07 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/152137 From 5ab97a764d9972b921016687f413972901491941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Tue, 5 Aug 2025 15:35:32 +0200 Subject: [PATCH 1/2] [clang][analyzer][NFCi] Pass if bind i

[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-07 Thread Endre Fülöp via cfe-commits
gamesh411 wrote: > Have you checked if any of the checkBind users used an `isa` or `dyncast` as > a proxy to determine if its an assignment expression or an initialization? I > suspect there could have been cases where they tried to use this as a proxy, > that we could not substitute to this e

[clang] [NFC][analyzer] Conversion to CheckerFamily: RetainCountChecker (PR #152138)

2025-08-07 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. I went through the patch, I like the minor naming changes, but of course the biggest win is the usage of frontends. Good job! https://github.com/llvm/llvm-project/pull/152138 ___ cfe-commits mai

[clang] [NFC][analyzer] Conversion to CheckerFamily: RetainCountChecker (PR #152138)

2025-08-07 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. https://github.com/llvm/llvm-project/pull/152138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-05 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/152137 From 5ab97a764d9972b921016687f413972901491941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Tue, 5 Aug 2025 15:35:32 +0200 Subject: [PATCH] [clang][analyzer][NFCi] Pass if bind is to

[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-05 Thread Endre Fülöp via cfe-commits
gamesh411 wrote: My proposed discussion points about this: Is the name `atDeclInit` (OK/meaningful enough) to expose to the API users? (I also thought about: isDecl, isInitialization, belongsToDecl, but none of these seemed great) Does the extra boolean flag introduce any performance overhead?

[clang] [clang][analyzer][NFCi] Pass if bind is to a Decl or not to checkBind (PR #152137)

2025-08-05 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 created https://github.com/llvm/llvm-project/pull/152137 Binding a value to location can happen when a new value is created or when and existing value is updated. This modification exposes whether the value binding happens at a declaration. This helps simplify the

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-08-04 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 closed https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-08-04 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/22] [clang][analyzer] Add StoreToImmuta

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-08-02 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/21] [clang][analyzer] Add StoreToImmuta

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-08-02 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/21] [clang][analyzer] Add StoreToImmuta

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-08-01 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-08-01 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,23 @@ +// Global const variable gamesh411 wrote: Removed redundant comments from the example. https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-08-01 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,168 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-08-01 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/20] [clang][analyzer] Add StoreToImmuta

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-08-01 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/18] [clang][analyzer] Add StoreToImmuta

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -11,6 +11,7 @@ // //===--===// +#include "clang/AST/ParentMap.h" gamesh411 wrote: Yeah, this was part of my attempt to use the structure of the AST to detect the lambda initialisation. R

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -29,11 +30,59 @@ class StoreToImmutableChecker : public Checker { void checkBind(SVal Loc, SVal Val, const Stmt *S, CheckerContext &C) const; private: + bool isInitializationContext(const Stmt *S, CheckerContext &C) const; bool isEffectivelyConstRegion(const MemRegio

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -std=c++14 -verify %s + +// expected-no-diagnostics + +// In C++14 and before, when initializing a lambda, the statement given in the checkBind callback is not the whole DeclExpr, but the

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/16] [clang][analyzer] Add StoreToImmuta

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,187 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,187 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; gamesh411 wrote: I have made the simplification, and it still has an example for a global and a local variable

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; + +void test_global_const() { gamesh411 wrote: Simplified https://github.com/llvm/llvm-project/pull/150417 ___

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s gamesh411 wrote: Removed https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; + +void test_global_const() { + *(int *)&global_const = 100; // warn: Writing to immutable memory +} + +// String literal +// NO

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -std=c++14 -verify %s gamesh411 wrote: Added versions from C++11 - C++20 https://github.com/llvm/llvm-project/pull/150417 ___

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/15] [clang][analyzer] Add StoreToImmuta

[clang] [NFC][analyzer] Update docs of CodeChecker --ctu-ast-mode (PR #144901)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. I can confirm that this is the most current version. https://github.com/llvm/llvm-project/pull/144901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,187 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; + +void test_global_const() { gamesh411 wrote: Maybe just a single function that tests all use cases would be m

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -std=c++14 -verify %s gamesh411 wrote: Add more C++ standard versions. https://github.com/llvm/llvm-project/pull/150417 ___ cf

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; gamesh411 wrote: Don't emphasise "global" in variable names, as globals and local variables are handled the sa

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 commented: Review suggestions resulting from consulting with @NagyDonat https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s gamesh411 wrote: No need for a runline in an example file. https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,187 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; + +void test_global_const() { + *(int *)&global_const = 100; // warn: Writing to immutable memory +} + +// String literal +// NO

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,134 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [NFC][analyzer] Clean bug type use in BasicObjCFoundationChecks (PR #151141)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. https://github.com/llvm/llvm-project/pull/151141 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Conversion to CheckerFamily: NSOrCFErrorDerefChecker (PR #151171)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. https://github.com/llvm/llvm-project/pull/151171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/11] [clang][analyzer] Add StoreToImmuta

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,136 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
@@ -29,29 +29,24 @@ class StoreToImmutableChecker : public Checker { void checkBind(SVal Loc, SVal Val, const Stmt *S, CheckerContext &C) const; private: - bool isConstVariable(const MemRegion *MR, CheckerContext &C) const; + bool isEffectivelyConstRegion(const MemRegion

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
@@ -62,22 +57,33 @@ bool StoreToImmutableChecker::isConstVariable(const MemRegion *MR, return true; } - // Check if this is an ElementRegion accessing a const array - if (const ElementRegion *ER = dyn_cast(MR)) { -return isConstQualifiedType(ER->getSuperRegion()

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
@@ -8,6 +8,7 @@ void test_global_const() { } // String literal +// NOTE: This only works in C++, not in C, as the analyzer treats string literals as non-const char arrays in C mode. gamesh411 wrote: The const keyword was introduced in the ANSI C standard (C8

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 1/8] [clang][analyzer] Add StoreToImmutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-29 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,134 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 1/5] [clang][analyzer] Add StoreToImmutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,146 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory checker -*- 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-Identi

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,134 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 1/4] [clang][analyzer] Add StoreToImmutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 1/3] [clang][analyzer] Add StoreToImmutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,134 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- 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: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,166 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker +// This tests direct writes to immutable regions without function modeling + +// Direct write to a const global varia

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,166 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker +// This tests direct writes to immutable regions without function modeling + +// Direct write to a const global varia

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-28 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,166 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker +// This tests direct writes to immutable regions without function modeling + +// Direct write to a const global varia

[clang] [analyzer] Conversion to CheckerFamily: DereferenceChecker (PR #150442)

2025-07-28 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. Great simplification. https://github.com/llvm/llvm-project/pull/150442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-07-24 Thread Endre Fülöp via cfe-commits
gamesh411 wrote: The overall check implementation looks great. Once the name is settled, it is ready IMO. https://github.com/llvm/llvm-project/pull/140086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-24 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-24 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 1/2] [clang][analyzer] Add StoreToImmutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-24 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-24 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,146 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory checker -*- 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-Identi

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-24 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,166 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker +// This tests direct writes to immutable regions without function modeling + +// Direct write to a const global varia

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-24 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,146 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory checker -*- 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-Identi

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-24 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 created https://github.com/llvm/llvm-project/pull/150417 This adds alpha.core.StoreToImmutable, a new alpha checker that detects writes to immutable memory regions, implementing part of SEI CERT Rule ENV30-C. The original proposal only handled global const variables,

[clang] [analyzer] Conversion to CheckerFamily: MallocChecker (PR #147080)

2025-07-08 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. https://github.com/llvm/llvm-project/pull/147080 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-28 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. This is a nice cleanup change. I have checked the test cases and the reasoning behind the removals. It is also welcome that these reasons are documented, at least in the PR. @NagyDonat What do you think about making these reasoning snippe

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-17 Thread Endre Fülöp via cfe-commits
@@ -588,20 +603,48 @@ void ArrayBoundChecker::performCheck(const Expr *E, CheckerContext &C) const { State, ByteOffset, SVB.makeZeroArrayIndex(), SVB); if (PrecedesLowerBound) { - // The offset may be invalid (negative)... - if (!WithinLowerBound) { -

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-17 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/127117 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-17 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. LGTM. An interesting thing could be to track in the analyzer the number of suppressed underflows (i.e.: the number of times we resorted to hacking with this solution). That way, we could have more information about how far we deviate fro

[clang] [analyzer] Add option assume-at-least-one-iteration (PR #125494)

2025-02-12 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. https://github.com/llvm/llvm-project/pull/125494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add option assume-one-iteration (PR #125494)

2025-02-06 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/125494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add option assume-one-iteration (PR #125494)

2025-02-06 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/125494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add option assume-one-iteration (PR #125494)

2025-02-06 Thread Endre Fülöp via cfe-commits
@@ -294,6 +294,16 @@ ANALYZER_OPTION( bool, ShouldUnrollLoops, "unroll-loops", "Whether the analysis should try to unroll loops with known bounds.", false) +ANALYZER_OPTION( +bool, ShouldAssumeOneIteration, "assume-one-iteration", +"Whether the analyzer should

[clang] [analyzer] Add option assume-one-iteration (PR #125494)

2025-02-06 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/125494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add option assume-one-iteration (PR #125494)

2025-02-06 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 commented: IMO. This enables a heuristic that is closer to real-world code usage, and having this option is valuable. I left one comment inline. https://github.com/llvm/llvm-project/pull/125494 ___ cfe-commits mailing list

[clang] [clang][analyzer][doc] Migrate ClangSA www FAQ section (PR #112831)

2024-10-25 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/112831 From 327a84633d6d2029e11642dac07d63c90f2577d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 17 Oct 2024 19:53:17 +0200 Subject: [PATCH 1/2] [clang][analyzer][doc] Migrate ClangS

[clang] [clang][analyzer][doc] Update Clang SA www docs index.html (PR #112833)

2024-10-25 Thread Endre Fülöp via cfe-commits
@@ -121,10 +80,25 @@ Mac OS X - Other Platforms - For other platforms, please follow the instructions for building the analyzer from - source code. +The static analyzer is part of Clang. Please refer to the +https://releases.llvm.org/download.html";>LLVM +

[clang] [clang][analyzer][doc] Migrate ClangSA www FAQ section (PR #112831)

2024-10-25 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 closed https://github.com/llvm/llvm-project/pull/112831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer][doc] Update Clang SA www docs index.html (PR #112833)

2024-10-24 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 closed https://github.com/llvm/llvm-project/pull/112833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer][doc] Update Clang SA www docs index.html (PR #112833)

2024-10-24 Thread Endre Fülöp via cfe-commits
@@ -69,48 +69,7 @@ Clang Static Analyzer -The Clang Static Analyzer is a source code analysis tool that finds bugs in -C, C++, and Objective-C programs. - -Currently it can be run either from the command - line or if you use macOS then within Xcode. When -invoked from the co

  1   2   3   >