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
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
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
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
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
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
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
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
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
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
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?
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
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
@@ -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
@@ -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
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
@@ -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
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 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
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
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
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
@@ -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 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
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
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
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
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,
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
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
@@ -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) {
-
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
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
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
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
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
@@ -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
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
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
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
@@ -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
+
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
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
@@ -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 - 100 of 253 matches
Mail list logo