https://github.com/malavikasamak updated
https://github.com/llvm/llvm-project/pull/135087
>From edbdfa66b45be76014f003f8e2d6f2d2871ea253 Mon Sep 17 00:00:00 2001
From: MalavikaSamak
Date: Wed, 9 Apr 2025 14:31:06 -0700
Subject: [PATCH] Update the documentation for the unsafe_buffer_usage
attri
https://github.com/malavikasamak closed
https://github.com/llvm/llvm-project/pull/135087
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -891,7 +891,9 @@ AST_MATCHER(CallExpr, hasUnsafeSnprintfBuffer) {
// Pattern 1:
static StringRef SizedObjs[] = {"span", "array", "vector",
- "basic_string_view", "basic_string"};
+ "basic_string_view", "b
malavikasamak wrote:
Identifying safe operations on String literals has already landed as part of:
https://github.com/llvm/llvm-project/pull/115552. However, identifying safe
pointer arithmetic is not yet available. So, maybe we should revisit this PR
once again.
https://github.com/llvm/llvm
https://github.com/malavikasamak approved this pull request.
https://github.com/llvm/llvm-project/pull/137248
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/malavikasamak updated
https://github.com/llvm/llvm-project/pull/112284
>From bf1f0b88c26cef3fd7eab40341558e1742c62321 Mon Sep 17 00:00:00 2001
From: MalavikaSamak
Date: Fri, 11 Oct 2024 12:24:58 -0700
Subject: [PATCH] [Wunsafe-buffer-usage] False positives for & expression
i
malavikasamak wrote:
@dtarditi FYI.
https://github.com/llvm/llvm-project/pull/112284
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -245,3 +243,40 @@ struct AggregateViaDefaultInit {
void testAggregateViaDefaultInit() {
AggregateViaDefaultInit A;
};
+
+struct A {
+ int arr[2];
+
+ [[clang::unsafe_buffer_usage]]
+ int *ptr;
+};
+
+namespace std{
+ template class span {
+
+ T *elements;
+
+ pu
@@ -462,8 +462,25 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) {
// bug
if (ArrIdx.isNonNegative() && ArrIdx.getLimitedValue() < limit)
return true;
- }
- return false;
+ } else if (const auto *BE = dyn_cast(IndexExpr)) {
+if (BE->getOpcode() !=
@@ -462,8 +462,25 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) {
// bug
if (ArrIdx.isNonNegative() && ArrIdx.getLimitedValue() < limit)
return true;
- }
- return false;
+ } else if (const auto *BE = dyn_cast(IndexExpr)) {
+if (BE->getOpcode() !=
https://github.com/malavikasamak updated
https://github.com/llvm/llvm-project/pull/125671
>From 821a4b46705375bb34e207d406d8d7e9a2818f85 Mon Sep 17 00:00:00 2001
From: MalavikaSamak
Date: Fri, 31 Jan 2025 13:19:46 +0530
Subject: [PATCH 1/2] [Wunsafe-buffer-usage] Turn off unsafe-buffer warning
https://github.com/malavikasamak deleted
https://github.com/llvm/llvm-project/pull/125671
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -245,3 +243,40 @@ struct AggregateViaDefaultInit {
void testAggregateViaDefaultInit() {
AggregateViaDefaultInit A;
};
+
+struct A {
+ int arr[2];
+
+ [[clang::unsafe_buffer_usage]]
+ int *ptr;
+};
+
+namespace std{
+ template class span {
+
+ T *elements;
+
+ pu
https://github.com/malavikasamak updated
https://github.com/llvm/llvm-project/pull/125671
>From 821a4b46705375bb34e207d406d8d7e9a2818f85 Mon Sep 17 00:00:00 2001
From: MalavikaSamak
Date: Fri, 31 Jan 2025 13:19:46 +0530
Subject: [PATCH 1/3] [Wunsafe-buffer-usage] Turn off unsafe-buffer warning
https://github.com/malavikasamak closed
https://github.com/llvm/llvm-project/pull/112284
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -245,3 +243,56 @@ struct AggregateViaDefaultInit {
void testAggregateViaDefaultInit() {
AggregateViaDefaultInit A;
};
+
+struct A {
+ int arr[2];
+
+ [[clang::unsafe_buffer_usage]]
+ int *ptr;
+};
+
+namespace std{
+ template class span {
+
+ T *elements;
+
+ pu
https://github.com/malavikasamak updated
https://github.com/llvm/llvm-project/pull/112284
>From bf1f0b88c26cef3fd7eab40341558e1742c62321 Mon Sep 17 00:00:00 2001
From: MalavikaSamak
Date: Fri, 11 Oct 2024 12:24:58 -0700
Subject: [PATCH 1/2] [Wunsafe-buffer-usage] False positives for & expressio
@@ -462,8 +462,25 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) {
// bug
if (ArrIdx.isNonNegative() && ArrIdx.getLimitedValue() < limit)
return true;
- }
- return false;
+ } else if (const auto *BE = dyn_cast(IndexExpr)) {
malavikasa
https://github.com/malavikasamak closed
https://github.com/llvm/llvm-project/pull/125671
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
malavikasamak wrote:
I think we can close this PR, since we already merged this as part of
https://github.com/llvm/llvm-project/pull/115552
https://github.com/llvm/llvm-project/pull/115554
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:
malavikasamak wrote:
CC @dtarditi
https://github.com/llvm/llvm-project/pull/140113
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/malavikasamak closed
https://github.com/llvm/llvm-project/pull/140113
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/malavikasamak created
https://github.com/llvm/llvm-project/pull/140113
The -Wunsafe-buffer-usage analysis currently warns when a const sized array is
safely accessed, with an index that is bound by the remainder operator. The
false alarm is now suppressed.
Example:
int cir
https://github.com/malavikasamak updated
https://github.com/llvm/llvm-project/pull/140113
>From c6d8a58a8468fb3e6bcbe7d5935e2aa033745d99 Mon Sep 17 00:00:00 2001
From: MalavikaSamak
Date: Thu, 15 May 2025 10:46:01 -0700
Subject: [PATCH 1/2] [-Wunsafe-buffer-usage] Fix false warnings when const
101 - 124 of 124 matches
Mail list logo