https://github.com/t-rasmud created
https://github.com/llvm/llvm-project/pull/71862
None
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 1/3] [-Wunsafe-buffer-usage][WIP] Fixable gadget for AddA
https://github.com/t-rasmud edited
https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 1/4] [-Wunsafe-buffer-usage][WIP] Fixable gadget for AddAssign
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 1/5] [-Wunsafe-buffer-usage][WIP] Fixable gadget for AddAssign
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 1/6] [-Wunsafe-buffer-usage][WIP] Fixable gadget for AddAssign
@@ -1028,6 +1028,50 @@ class UPCPreIncrementGadget : public FixableGadget {
}
};
+// Representing a pointer type expression of the form `Ptr += n` in an
+// Unspecified Untyped Context (UUC):
+class UUCAddAssignGadget : public FixableGadget {
+private:
+ static constexpr co
https://github.com/t-rasmud closed
https://github.com/llvm/llvm-project/pull/71862
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 1/7] [-Wunsafe-buffer-usage][WIP] Fixable gadget for AddAssign
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 1/8] [-Wunsafe-buffer-usage][WIP] Fixable gadget for AddAssign
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 1/9] [-Wunsafe-buffer-usage][WIP] Fixable gadget for AddAssign
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \
+// RUN:-fsafe-buffer-usage-suggestions \
+// RUN:-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+void foo(int * , int *);
+
+void add_assign_test(unsigned int n, int *a, int y)
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 01/10] [-Wunsafe-buffer-usage][WIP] Fixable gadget for
AddAssi
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 01/11] [-Wunsafe-buffer-usage][WIP] Fixable gadget for
AddAssi
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 01/12] [-Wunsafe-buffer-usage][WIP] Fixable gadget for
AddAssi
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 01/13] [-Wunsafe-buffer-usage][WIP] Fixable gadget for
AddAssi
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/71862
>From 6636745d1c444747a33c91b366a730d81ca5db5a Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Wed, 1 Nov 2023 13:43:12 -0700
Subject: [PATCH 01/14] [-Wunsafe-buffer-usage][WIP] Fixable gadget for
AddAssi
@@ -721,6 +721,33 @@ class UnsafeBufferUsageAttrGadget : public WarningGadget {
DeclUseList getClaimedVarUseSites() const override { return {}; }
};
+// Warning gadget for unsafe invocation of span::data method.
+// Triggers when the pointer returned by the invocation is imm
https://github.com/t-rasmud edited
https://github.com/llvm/llvm-project/pull/75650
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/75650
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud approved this pull request.
https://github.com/llvm/llvm-project/pull/75665
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/75650
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Rashmi Mudduluru
Date: 2022-06-30T15:20:10-07:00
New Revision: eb1d908e5cf7279b98b84d1587d4665d3cdecbe9
URL:
https://github.com/llvm/llvm-project/commit/eb1d908e5cf7279b98b84d1587d4665d3cdecbe9
DIFF:
https://github.com/llvm/llvm-project/commit/eb1d908e5cf7279b98b84d1587d4665d3cdecbe9.di
Author: Rashmi Mudduluru
Date: 2022-08-02T13:57:44-07:00
New Revision: 95a92995d45fc6fada43ecd91eba3e7aea90487a
URL:
https://github.com/llvm/llvm-project/commit/95a92995d45fc6fada43ecd91eba3e7aea90487a
DIFF:
https://github.com/llvm/llvm-project/commit/95a92995d45fc6fada43ecd91eba3e7aea90487a.di
Author: Rashmi Mudduluru
Date: 2022-08-05T12:36:03-07:00
New Revision: 13bc71310920dced155328e25aa382dc2bb1ef9f
URL:
https://github.com/llvm/llvm-project/commit/13bc71310920dced155328e25aa382dc2bb1ef9f
DIFF:
https://github.com/llvm/llvm-project/commit/13bc71310920dced155328e25aa382dc2bb1ef9f.di
Author: Rashmi Mudduluru
Date: 2022-02-10T18:52:48-08:00
New Revision: ce420820c815e806bab9c5f17cb3b829a616548a
URL:
https://github.com/llvm/llvm-project/commit/ce420820c815e806bab9c5f17cb3b829a616548a
DIFF:
https://github.com/llvm/llvm-project/commit/ce420820c815e806bab9c5f17cb3b829a616548a.di
Author: Rashmi Mudduluru
Date: 2022-02-16T09:25:53-08:00
New Revision: 572e2cd56a43429bdbc88c886e260b5facff9048
URL:
https://github.com/llvm/llvm-project/commit/572e2cd56a43429bdbc88c886e260b5facff9048
DIFF:
https://github.com/llvm/llvm-project/commit/572e2cd56a43429bdbc88c886e260b5facff9048.di
Author: Rashmi Mudduluru
Date: 2023-01-31T11:43:34-08:00
New Revision: acc3cc69e4d1c8e199fde51798a5a2a6edb35796
URL:
https://github.com/llvm/llvm-project/commit/acc3cc69e4d1c8e199fde51798a5a2a6edb35796
DIFF:
https://github.com/llvm/llvm-project/commit/acc3cc69e4d1c8e199fde51798a5a2a6edb35796.di
Author: Rashmi Mudduluru
Date: 2023-01-17T16:30:13-08:00
New Revision: fe93da22aa7bd57e277571cd692c7c0cc51c0478
URL:
https://github.com/llvm/llvm-project/commit/fe93da22aa7bd57e277571cd692c7c0cc51c0478
DIFF:
https://github.com/llvm/llvm-project/commit/fe93da22aa7bd57e277571cd692c7c0cc51c0478.di
Author: Rashmi Mudduluru
Date: 2023-09-19T14:20:45-07:00
New Revision: 87b8c85bba5298fea657b71eb7c75aeb1afa446d
URL:
https://github.com/llvm/llvm-project/commit/87b8c85bba5298fea657b71eb7c75aeb1afa446d
DIFF:
https://github.com/llvm/llvm-project/commit/87b8c85bba5298fea657b71eb7c75aeb1afa446d.di
Author: Rashmi Mudduluru
Date: 2023-07-18T15:27:59-07:00
New Revision: 3ea673a97b0583affc22345b9d62e863ba36b3d8
URL:
https://github.com/llvm/llvm-project/commit/3ea673a97b0583affc22345b9d62e863ba36b3d8
DIFF:
https://github.com/llvm/llvm-project/commit/3ea673a97b0583affc22345b9d62e863ba36b3d8.di
Author: Rashmi Mudduluru
Date: 2023-07-18T15:36:09-07:00
New Revision: 1e62587a48a33b3bf5939e1eef2fd4e41b7e75f6
URL:
https://github.com/llvm/llvm-project/commit/1e62587a48a33b3bf5939e1eef2fd4e41b7e75f6
DIFF:
https://github.com/llvm/llvm-project/commit/1e62587a48a33b3bf5939e1eef2fd4e41b7e75f6.di
Author: Rashmi Mudduluru
Date: 2023-07-20T10:00:16-07:00
New Revision: 27c10337831c94ef59f8790f6ca1c3d1b66b4494
URL:
https://github.com/llvm/llvm-project/commit/27c10337831c94ef59f8790f6ca1c3d1b66b4494
DIFF:
https://github.com/llvm/llvm-project/commit/27c10337831c94ef59f8790f6ca1c3d1b66b4494.di
Author: Rashmi Mudduluru
Date: 2023-07-25T13:40:33-07:00
New Revision: 070358ec92350c13b0b6c60fbb03bf35a7a00251
URL:
https://github.com/llvm/llvm-project/commit/070358ec92350c13b0b6c60fbb03bf35a7a00251
DIFF:
https://github.com/llvm/llvm-project/commit/070358ec92350c13b0b6c60fbb03bf35a7a00251.di
Author: Rashmi Mudduluru
Date: 2023-07-26T17:07:36-07:00
New Revision: a6ae740e743a2241f7104c13152cd0a0582765c5
URL:
https://github.com/llvm/llvm-project/commit/a6ae740e743a2241f7104c13152cd0a0582765c5
DIFF:
https://github.com/llvm/llvm-project/commit/a6ae740e743a2241f7104c13152cd0a0582765c5.di
Author: Rashmi Mudduluru
Date: 2023-08-15T15:41:56-07:00
New Revision: cf1c64b94d94105f61e308e57eb963b722d22d77
URL:
https://github.com/llvm/llvm-project/commit/cf1c64b94d94105f61e308e57eb963b722d22d77
DIFF:
https://github.com/llvm/llvm-project/commit/cf1c64b94d94105f61e308e57eb963b722d22d77.di
Author: Rashmi Mudduluru
Date: 2023-08-17T16:18:38-07:00
New Revision: 2afcda693acba8d63887a6bb0605038b1563c64c
URL:
https://github.com/llvm/llvm-project/commit/2afcda693acba8d63887a6bb0605038b1563c64c
DIFF:
https://github.com/llvm/llvm-project/commit/2afcda693acba8d63887a6bb0605038b1563c64c.di
Author: Rashmi Mudduluru
Date: 2023-06-21T15:54:09-07:00
New Revision: db3dcedb9cedcec4a9570fda7406490c642df8ae
URL:
https://github.com/llvm/llvm-project/commit/db3dcedb9cedcec4a9570fda7406490c642df8ae
DIFF:
https://github.com/llvm/llvm-project/commit/db3dcedb9cedcec4a9570fda7406490c642df8ae.di
Author: Rashmi Mudduluru
Date: 2023-05-24T16:20:55-07:00
New Revision: ee6b08e99375fc48d1e5848704a66c2e8e57eb3b
URL:
https://github.com/llvm/llvm-project/commit/ee6b08e99375fc48d1e5848704a66c2e8e57eb3b
DIFF:
https://github.com/llvm/llvm-project/commit/ee6b08e99375fc48d1e5848704a66c2e8e57eb3b.di
Author: Rashmi Mudduluru
Date: 2023-05-25T11:31:27-07:00
New Revision: 171dfc5462a23b7e8ace31f4d9206b972b38ffbc
URL:
https://github.com/llvm/llvm-project/commit/171dfc5462a23b7e8ace31f4d9206b972b38ffbc
DIFF:
https://github.com/llvm/llvm-project/commit/171dfc5462a23b7e8ace31f4d9206b972b38ffbc.di
Author: Rashmi Mudduluru
Date: 2023-06-16T13:28:34-07:00
New Revision: d1ae844dc2cc58bc762135d9500464c61d50f4f9
URL:
https://github.com/llvm/llvm-project/commit/d1ae844dc2cc58bc762135d9500464c61d50f4f9
DIFF:
https://github.com/llvm/llvm-project/commit/d1ae844dc2cc58bc762135d9500464c61d50f4f9.di
@@ -289,3 +289,32 @@ void foo() {
}
} // namespace local_assignment_to_global
+
+namespace local_var_in_recursive_function {
+
+struct TreeNode {
+ Ref create() { return Ref(*new TreeNode); }
+
+ void ref() const { ++refCount; }
+ void deref() const {
+if (!--refCount)
https://github.com/t-rasmud closed
https://github.com/llvm/llvm-project/pull/110973
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
t-rasmud wrote:
LGTM!
https://github.com/llvm/llvm-project/pull/110973
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud reopened
https://github.com/llvm/llvm-project/pull/110973
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud approved this pull request.
https://github.com/llvm/llvm-project/pull/110973
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud created
https://github.com/llvm/llvm-project/pull/113377
TFA wasn't recognizing `__libcpp_verbose_abort` as trivial causing
`std::array::operator[]` also not being recongnized as trivial.
>From 9e21b0f2f0968a5f8810c797913318884dcc8c7b Mon Sep 17 00:00:00 2001
From:
@@ -48,6 +48,64 @@ bool isRefcountedStringsHack(const VarDecl *V) {
return false;
}
+struct GuardianVisitor : public RecursiveASTVisitor {
+ using Base = RecursiveASTVisitor;
+
+ const VarDecl *Guardian{nullptr};
+
+public:
+ explicit GuardianVisitor(const VarDecl *Guardi
@@ -83,6 +83,65 @@ void foo7(RefCountable* obj) {
bar.obj->method();
}
+void foo8(RefCountable* obj) {
+ RefPtr foo;
+ {
+RefCountable *bar = foo.get();
+// expected-warning@-1{{Local variable 'bar' is uncounted and unsafe
[alpha.webkit.UncountedLocalVarsChecker]}
@@ -83,6 +83,65 @@ void foo7(RefCountable* obj) {
bar.obj->method();
}
+void foo8(RefCountable* obj) {
+ RefPtr foo;
+ {
+RefCountable *bar = foo.get();
+// expected-warning@-1{{Local variable 'bar' is uncounted and unsafe
[alpha.webkit.UncountedLocalVarsChecker]}
@@ -83,6 +83,77 @@ void foo7(RefCountable* obj) {
bar.obj->method();
}
+void foo8(RefCountable* obj) {
+ RefPtr foo;
+ {
+RefCountable *bar = foo.get();
+// expected-warning@-1{{Local variable 'bar' is uncounted and unsafe
[alpha.webkit.UncountedLocalVarsChecker]}
@@ -56,7 +60,8 @@ bool tryToFindPtrOrigin(
if (StopAtFirstRefCountedObj) {
if (auto *ConversionFunc =
dyn_cast_or_null(cast->getConversionFunction()))
{
- if (isCtorOfRefCounted(ConversionFunc))
+ if (isCtorOfRefCounted(Conversio
@@ -63,18 +63,29 @@ std::optional isUncounted(const clang::CXXRecordDecl*
Class);
/// class, false if not, std::nullopt if inconclusive.
std::optional isUncountedPtr(const clang::QualType T);
-/// \returns true if Name is a RefPtr, Ref, or its variant, false if not.
-bool isR
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/113377
>From 0374a38b9abff286048dd58067c360257ab96318 Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Tue, 22 Oct 2024 13:16:30 -0700
Subject: [PATCH] [WebKit Checkers] Make TrivialFunctionAnalysis recognize
st
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/113377
>From 9e21b0f2f0968a5f8810c797913318884dcc8c7b Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Tue, 22 Oct 2024 13:16:30 -0700
Subject: [PATCH 1/2] [WebKit Checkers] Make TrivialFunctionAnalysis recognize
@@ -83,6 +83,77 @@ void foo7(RefCountable* obj) {
bar.obj->method();
}
+void foo8(RefCountable* obj) {
+ RefPtr foo;
+ {
+RefCountable *bar = foo.get();
+// expected-warning@-1{{Local variable 'bar' is uncounted and unsafe
[alpha.webkit.UncountedLocalVarsChecker]}
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/114606
>From cc19550fdbaca4b77e90de57c472a31a8c3f8293 Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Fri, 1 Nov 2024 14:10:50 -0700
Subject: [PATCH 1/2] [Webkit Checkers] Introduce a Webkit checker for memory
@@ -0,0 +1,86 @@
+//===- MemoryUnsafeCastChecker.cpp -*- C++ -*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache
https://github.com/t-rasmud approved this pull request.
I have a couple of small nits that I left as comments. Otherwise LGTM!
Also, thank you for writing detailed explanations in your PR descriptions, they
help me catch up to your code quickly.
https://github.com/llvm/llvm-project/pull/113845
@@ -45,8 +49,62 @@ class UncountedLambdaCapturesChecker
bool shouldVisitTemplateInstantiations() const { return true; }
bool shouldVisitImplicitCode() const { return false; }
- bool VisitLambdaExpr(LambdaExpr *L) {
-Checker->visitLambdaExpr(L);
+
https://github.com/t-rasmud edited
https://github.com/llvm/llvm-project/pull/113845
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -45,8 +49,62 @@ class UncountedLambdaCapturesChecker
bool shouldVisitTemplateInstantiations() const { return true; }
bool shouldVisitImplicitCode() const { return false; }
- bool VisitLambdaExpr(LambdaExpr *L) {
-Checker->visitLambdaExpr(L);
+
https://github.com/t-rasmud created
https://github.com/llvm/llvm-project/pull/114606
This PR introduces a new checker `[alpha.webkit.MemoryUnsafeCastChecker]` that
warns all downcasts from a base type to a derived type.
rdar://137766829
>From cc19550fdbaca4b77e90de57c472a31a8c3f8293 Mon Sep 1
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/113377
>From 9e21b0f2f0968a5f8810c797913318884dcc8c7b Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Tue, 22 Oct 2024 13:16:30 -0700
Subject: [PATCH 1/3] [WebKit Checkers] Make TrivialFunctionAnalysis recognize
@@ -89,7 +182,25 @@ class UncountedLambdaCapturesChecker
}
printQuotedQualifiedName(Os, Capture.getCapturedVar());
-Os << " to uncounted type is unsafe.";
+Os << " to ref-counted / CheckedPtr capable type is unsafe.";
+
+PathDiagnosticLocation BSLoc(Capture
https://github.com/t-rasmud approved this pull request.
LGTM! Left a couple nits, mainly about readability of the warning.
https://github.com/llvm/llvm-project/pull/114897
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/c
https://github.com/t-rasmud edited
https://github.com/llvm/llvm-project/pull/114897
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -45,32 +52,118 @@ class UncountedLambdaCapturesChecker
bool shouldVisitTemplateInstantiations() const { return true; }
bool shouldVisitImplicitCode() const { return false; }
- bool VisitLambdaExpr(LambdaExpr *L) {
-Checker->visitLambdaExpr(L);
+
https://github.com/t-rasmud closed
https://github.com/llvm/llvm-project/pull/113377
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/110222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,342 @@
+// RUN: %clang_analyze_cc1
-analyzer-checker=alpha.webkit.UncheckedLocalVarsChecker -verify %s
+
+#include "mock-types.h"
+#include "mock-system-header.h"
+
+void someFunction();
+
+namespace raw_ptr {
+void foo() {
+ CheckedObj *bar;
+ // FIXME: later on we
https://github.com/t-rasmud approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/113708
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/113859
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -27,3 +27,27 @@ -(void)testCasts:(BaseClass*)base {
base = (BaseClass*)base; // no warning
}
@end
+
+template
+class WrappedObject
+{
+public:
+ T get() const { return mMetalObject; }
+ T mMetalObject = nullptr;
+};
+
+@protocol MTLCommandEncoder
+@end
+@protocol MTLRe
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/114606
>From cc19550fdbaca4b77e90de57c472a31a8c3f8293 Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Fri, 1 Nov 2024 14:10:50 -0700
Subject: [PATCH 1/5] [Webkit Checkers] Introduce a Webkit checker for memory
@@ -0,0 +1,117 @@
+//===- MemoryUnsafeCastChecker.cpp -*- C++ -*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apach
https://github.com/t-rasmud edited
https://github.com/llvm/llvm-project/pull/114606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/114606
>From cc19550fdbaca4b77e90de57c472a31a8c3f8293 Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Fri, 1 Nov 2024 14:10:50 -0700
Subject: [PATCH 1/3] [Webkit Checkers] Introduce a Webkit checker for memory
https://github.com/t-rasmud edited
https://github.com/llvm/llvm-project/pull/114522
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud approved this pull request.
I had a couple clarifying questions, otherwise LGTM!
https://github.com/llvm/llvm-project/pull/114522
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
@@ -1,4 +1,4 @@
-//===- UncountedCallArgsChecker.cpp --*- C++
-*-==//
+//===- RawPtrRefCallArgsChecker.cpp --*- C++
-*-==//
t-rasmud wrote:
Would it make sense to have documentation for `RawPtrCallArgsChec
@@ -55,10 +55,18 @@ bool isCheckedPtr(const clang::CXXRecordDecl *Class);
/// not, std::nullopt if inconclusive.
std::optional isUncounted(const clang::QualType T);
+/// \returns true if \p Class is CheckedPtr capable AND not checked, false if
+/// not, std::nullopt if inconcl
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/114606
>From cc19550fdbaca4b77e90de57c472a31a8c3f8293 Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Fri, 1 Nov 2024 14:10:50 -0700
Subject: [PATCH 1/7] [Webkit Checkers] Introduce a Webkit checker for memory
https://github.com/t-rasmud created
https://github.com/llvm/llvm-project/pull/117021
Add `ObjCInterfaceDecl` to the list of types supported by the `hasType` and
`hasDeclaration` matchers, `ObjCObjectPointerType` to the list of types
supported by `pointee`.
>From 87ba2a10ca7435fdf6b5c47d2c1c97
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/117021
>From 87ba2a10ca7435fdf6b5c47d2c1c97c1e188cfcd Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Tue, 19 Nov 2024 14:50:24 -0800
Subject: [PATCH 1/2] [ASTMatchers] AST matcher support for ObjC pointers
Add
https://github.com/t-rasmud approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/115594
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/115695
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -145,25 +145,36 @@ bool isCtorOfSafePtr(const clang::FunctionDecl *F) {
return isCtorOfRefCounted(F) || isCtorOfCheckedPtr(F);
}
-bool isSafePtrType(const clang::QualType T) {
+template
+static bool isPtrOfType(const clang::QualType T, Predicate Pred) {
QualType type
@@ -0,0 +1,66 @@
+// RUN: %clang_analyze_cc1
-analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
+
+#include "mock-types.h"
+
+namespace std {
+}
+
+namespace call_args_const_refptr_member {
+
+class Foo {
+public:
+ Foo();
+ void bar();
+
+private:
+ const RefP
@@ -145,25 +145,36 @@ bool isCtorOfSafePtr(const clang::FunctionDecl *F) {
return isCtorOfRefCounted(F) || isCtorOfCheckedPtr(F);
}
-bool isSafePtrType(const clang::QualType T) {
+template
+static bool isPtrOfType(const clang::QualType T, Predicate Pred) {
QualType type
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/114606
>From cc19550fdbaca4b77e90de57c472a31a8c3f8293 Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Fri, 1 Nov 2024 14:10:50 -0700
Subject: [PATCH 01/10] [Webkit Checkers] Introduce a Webkit checker for memory
t-rasmud wrote:
Friendly @ping for approval/feedback.
https://github.com/llvm/llvm-project/pull/117021
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,117 @@
+//===- MemoryUnsafeCastChecker.cpp -*- C++ -*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apach
https://github.com/t-rasmud updated
https://github.com/llvm/llvm-project/pull/114606
>From cc19550fdbaca4b77e90de57c472a31a8c3f8293 Mon Sep 17 00:00:00 2001
From: Rashmi Mudduluru
Date: Fri, 1 Nov 2024 14:10:50 -0700
Subject: [PATCH 1/6] [Webkit Checkers] Introduce a Webkit checker for memory
https://github.com/t-rasmud closed
https://github.com/llvm/llvm-project/pull/114606
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/t-rasmud approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/125662
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -63,6 +63,18 @@ template Function
adopt(Detail::Callab
return Function(impl, Function::Adopt);
}
+template
+class HashMap {
+public:
+ HashMap();
+ HashMap([[clang::noescape]] const Function&);
t-rasmud wrote:
Should we also have a similar test cas
https://github.com/t-rasmud approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/126016
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -163,10 +163,13 @@ bool isConstOwnerPtrMemberExpr(const clang::Expr *E) {
if (OCE->getOperator() == OO_Star && OCE->getNumArgs() == 1)
E = OCE->getArg(0);
}
- auto *ME = dyn_cast(E);
- if (!ME)
+ const ValueDecl *D = nullptr;
+ if (auto *ME = dyn_cast(E))
+
https://github.com/t-rasmud deleted
https://github.com/llvm/llvm-project/pull/126353
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -163,10 +163,13 @@ bool isConstOwnerPtrMemberExpr(const clang::Expr *E) {
if (OCE->getOperator() == OO_Star && OCE->getNumArgs() == 1)
E = OCE->getArg(0);
}
- auto *ME = dyn_cast(E);
- if (!ME)
+ const ValueDecl *D = nullptr;
+ if (auto *ME = dyn_cast(E))
+
1 - 100 of 182 matches
Mail list logo