Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8
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
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
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
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
https://github.com/NagyDonat approved this pull request.
LGTM, with one very minor nitpick in a comment.
https://github.com/llvm/llvm-project/pull/150417
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
@@ -0,0 +1,21 @@
+const int global_const = 42;
+
+struct TestStruct {
+ const int x;
+ int y;
+};
+
+void immutable_violation_examples() {
+ *(int *)&global_const = 100; // warn: Trying to write to immutable memory
+
+ const int local_const = 42;
+ *(int *)&local_const = 43;
https://github.com/NagyDonat 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
@@ -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
@@ -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://
@@ -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
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
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
@@ -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
@@ -0,0 +1,23 @@
+// Global const variable
NagyDonat wrote:
I would prefer removing this comment and "// Const struct member" because they
just state the obvious.
https://github.com/llvm/llvm-project/pull/150417
___
c
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
___
@@ -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
@@ -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
@@ -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
___
@@ -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
@@ -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
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
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= ,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= ,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= ,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= ,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= ,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= ,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= ,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= ,
Endre =?utf
https://github.com/NagyDonat 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
@@ -0,0 +1,32 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s
+
+// Global const variable
+const int global_const = 42;
NagyDonat wrote:
@steakhal You are right that globals and locals are handled differently _by the
checker imple
@@ -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
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
steakhal wro
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
steakhal wro
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
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
@@ -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
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
@@ -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
@@ -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
@@ -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()
@@ -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
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
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
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
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
@@ -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
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,134 @@
+//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache
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
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
@@ -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
@@ -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
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
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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
https://github.com/steakhal 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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
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
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
@@ -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
@@ -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
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
steakhal wrote:
FYI please never tag anyone in commit title/message. And make sure that holds
even if you push the Merge button on the GitHub UI. Otherwise the person would
get pinged and spammed by emails forever.
https://github.com/llvm/llv
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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.
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
@@ -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
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
https://github.com/steakhal 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
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
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
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
@@ -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
@@ -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
@@ -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
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h --
clang/docs/analyzer/checkers/storetoimmutable_examp
1 - 100 of 102 matches
Mail list logo