https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/108184
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/108352
This PR introduces new WebKit checker to warn a member variable that is a raw
reference or a raw pointer to an object, which is capable of creating a
CheckedRef/CheckedPtr.
>From ac0447762c98da3cfb41a6b462034e3a
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/2] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/3] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/4] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/108656
Improve the fix in 203a2ca8cd6af505e11a38aebceeaf864271042c by allowing
variable references and more ignoring of parentheses.
>From e86f101c5cd87db597c5fc8ab017b20adba98284 Mon Sep 17 00:00:00 2001
From: Ryosuke
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/108669
Treat a function call or property access via a Objective-C++ selector which
returns a Ref/RefPtr as safe.
>From 241fde13679b85e63126318520cd3f19029f49ad Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108669
>From 241fde13679b85e63126318520cd3f19029f49ad Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Sep 2024 19:01:57 -0700
Subject: [PATCH 1/2] [alpha.webkit.UncountedCallArgsChecker] Add support for
Object
https://github.com/rniwa 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
@@ -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/rniwa edited 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/rniwa updated
https://github.com/llvm/llvm-project/pull/110973
>From b8e81ee537b60371064c577e2bb630f6d25f2f82 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 3 Oct 2024 02:12:30 -0700
Subject: [PATCH 1/2] [alpha.webkit.UncountedLocalVarsChecker] Recursive
functions ar
@@ -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)
rniwa wrote:
Thanks for the review! Will wait for bots to catch up & merge.
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/rniwa updated
https://github.com/llvm/llvm-project/pull/110222
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 02:05:25 -0700
Subject: [PATCH 1/4] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef
This
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/110222
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 02:05:25 -0700
Subject: [PATCH 1/5] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef
This
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/110222
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 02:05:25 -0700
Subject: [PATCH 1/3] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef
This
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/98
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/110213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rniwa wrote:
Thanks for reviews!
https://github.com/llvm/llvm-project/pull/110213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/111222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/111222
Ignore std::forward when it appears while looking for the pointer origin.
>From a67655fa83adab03351aa02d0982dd6a20726939 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 4 Oct 2024 17:44:11 -0700
Subject: [
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/98
None
>From 6214c124ce0de7ca754ccd43cfda5a572dc76b12 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 4 Oct 2024 11:57:12 -0700
Subject: [PATCH] [alpha.webkit.UncountedCallArgsChecker] Add the support for
t
@@ -0,0 +1,33 @@
+// RUN: %clang_analyze_cc1
-analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
+// expected-no-diagnostics
+
+#include "mock-types.h"
+
+using size_t = __typeof(sizeof(int));
+namespace std{
+template
+class array {
+ T elements[N];
+
+ publi
@@ -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]}
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/113859
>From 8fce7f69eb5e28f6ec648ee0dc4cc23c793f64c0 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 27 Oct 2024 21:43:24 -0700
Subject: [PATCH 1/3] [alpha.webkit.UncountedLocalVarsChecker] Warn the use of
a raw
@@ -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]}
@@ -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,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]}
@@ -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
@@ -452,6 +454,10 @@ class RefCounted {
unsigned nonTrivial23() { return DerivedNumber("123").value(); }
SomeType nonTrivial24() { return SomeType("123"); }
+ void call_libcpp_verbose_abort() {
+ __libcpp_verbose_abort("%s", "aborting");
rniwa wrote:
@@ -452,6 +454,10 @@ class RefCounted {
unsigned nonTrivial23() { return DerivedNumber("123").value(); }
SomeType nonTrivial24() { return SomeType("123"); }
+ void call_libcpp_verbose_abort() {
rniwa wrote:
Can we add this as "trivial65" above right bene
https://github.com/rniwa approved this pull request.
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/rniwa updated
https://github.com/llvm/llvm-project/pull/113859
>From 8fce7f69eb5e28f6ec648ee0dc4cc23c793f64c0 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 27 Oct 2024 21:43:24 -0700
Subject: [PATCH 1/4] [alpha.webkit.UncountedLocalVarsChecker] Warn the use of
a raw
@@ -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]}
@@ -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]}
rniwa wrote:
> LGTM!
Thanks for the review!
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
https://github.com/rniwa closed 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
@@ -0,0 +1,154 @@
+// RUN: %clang_analyze_cc1
-analyzer-checker=alpha.webkit.MemoryUnsafeCastChecker -verify %s
+
+class Base { };
+class Derived : public Base { };
+
+void test_pointers(Base *base) {
+ Derived *derived_static = static_cast(base);
+ // expected-warning@-1{{Unsa
https://github.com/rniwa closed 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
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/114374
This PR makes webkit.UncountedLambdaCapturesChecker ignore trivial functions as
well as the one being passed to an argument with [[clang::noescape]] attribute.
This dramatically reduces the false positive rate fo
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/114372
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/114374
>From 474490de53c029ab59008bed9fc33f61db4cb1d7 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 31 Oct 2024 01:12:35 -0700
Subject: [PATCH] [webkit.UncountedLambdaCapturesChecker] Ignore trivial
functions a
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/113845
>From 1524ca532c9c1ef015c162360d4e4688296bbc0d Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 27 Oct 2024 16:30:48 -0700
Subject: [PATCH 1/5] [webkit.UncountedLambdaCapturesChecker] Ignore trivial
functio
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/113845
>From 1524ca532c9c1ef015c162360d4e4688296bbc0d Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 27 Oct 2024 16:30:48 -0700
Subject: [PATCH 1/6] [webkit.UncountedLambdaCapturesChecker] Ignore trivial
functio
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/114636
The member functions that define CheckedPtr capable type is
incrementCheckedPtrCount and decrementCheckedPtrCount after the rename.
>From 5675106782f0226297ea3e53fe7bca9137f710c4 Mon Sep 17 00:00:00 2001
From: Ry
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/114636
>From 5675106782f0226297ea3e53fe7bca9137f710c4 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 1 Nov 2024 20:39:10 -0700
Subject: [PATCH 1/2] Update clang static analyzers per rename of member
functions in
@@ -0,0 +1,151 @@
+// RUN: %clang_analyze_cc1
-analyzer-checker=alpha.webkit.MemoryUnsafeCastChecker -verify %s
+
+class Base { };
+class Derived : public Base { };
+
+void test_pointers(Base *base) {
+ Derived *derived_static = static_cast(base);
+ // expected-warning@-1{{Memo
@@ -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/rniwa updated
https://github.com/llvm/llvm-project/pull/113845
>From 1524ca532c9c1ef015c162360d4e4688296bbc0d Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 27 Oct 2024 16:30:48 -0700
Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Ignore trivial
functio
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/113708
This PR introduces alpha.webkit.UncheckedLocalVarsChecker which detects a raw
reference or a raw pointer local, static, or global variable to a CheckedPtr
capable object without a guardian variable in an outer sc
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/113708
>From cf5ca301bc9ed2c65eed92e7299bf598d5f88103 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 14 Sep 2024 01:46:23 -0700
Subject: [PATCH 1/2] Introduce a new WebKit checker for a unchecked local
variable
https://github.com/rniwa closed 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
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/113859
>From 8fce7f69eb5e28f6ec648ee0dc4cc23c793f64c0 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 27 Oct 2024 21:43:24 -0700
Subject: [PATCH 1/2] [alpha.webkit.UncountedLocalVarsChecker] Warn the use of
a raw
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/113859
This checker has a notion of a guardian variable which is a variable and keeps
the object pointed to by a raw pointer / reference in an inner scope alive long
enough to "guard" it from use-after-free. But such a
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/113845
This PR makes webkit.UncountedLambdaCapturesChecker ignore trivial functions as
well as the one being passed to an argument with [[clang::noescape]] attribute.
This dramatically reduces the false positive rate fo
@@ -45,32 +52,118 @@ class UncountedLambdaCapturesChecker
bool shouldVisitTemplateInstantiations() const { return true; }
bool shouldVisitImplicitCode() const { return false; }
- bool VisitLambdaExpr(LambdaExpr *L) {
-Checker->visitLambdaExpr(L);
+
@@ -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/rniwa created
https://github.com/llvm/llvm-project/pull/115594
Treat const Ref, RefPtr, CheckedRef, CheckedPtr member variables as safe
pointer origin in WebKit's local variable and call arguments checkers.
>From 28ee8321eb6e405fd1ebae9043c3ffafe20a4b35 Mon Sep 17 00:00:00 2
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/115695
Treat member function calls to ref() and incrementCheckedPtrCount() as trivial
so that a function which returns RefPtr/Ref out of a raw reference / pointer is
also considered trivial.
>From 7b4aaedcf86d583c1cf86
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/114897
>From d08c1b364c392aa42b7ef71528a52ab6a7d9c548 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 4 Nov 2024 16:01:49 -0800
Subject: [PATCH 1/3] [webkit.UncountedLambdaCapturesChecker] Ignore trivial
function
@@ -56,7 +60,8 @@ bool tryToFindPtrOrigin(
if (StopAtFirstRefCountedObj) {
if (auto *ConversionFunc =
dyn_cast_or_null(cast->getConversionFunction()))
{
- if (isCtorOfRefCounted(ConversionFunc))
+ if (isCtorOfRefCounted(Conversio
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/110222
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 02:05:25 -0700
Subject: [PATCH 1/6] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef
This
https://github.com/rniwa closed 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
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/115594
>From 28ee8321eb6e405fd1ebae9043c3ffafe20a4b35 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 9 Nov 2024 00:14:36 -0800
Subject: [PATCH 1/2] [Webkit Checkers] Treat const member variables as a safe
origin
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/115594
>From 28ee8321eb6e405fd1ebae9043c3ffafe20a4b35 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 9 Nov 2024 00:14:36 -0800
Subject: [PATCH 1/3] [Webkit Checkers] Treat const member variables as a safe
origin
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/115594
>From 28ee8321eb6e405fd1ebae9043c3ffafe20a4b35 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 9 Nov 2024 00:14:36 -0800
Subject: [PATCH 1/4] [Webkit Checkers] Treat const member variables as a safe
origin
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/114372
Reverts llvm/llvm-project#113845. Introduced a test failure.
>From ab286462f15736a6e86f0113eab473fb859744be Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 31 Oct 2024 00:27:46 -0700
Subject: [PATCH] =?UTF
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/114522
This PR introduces alpha.webkit.UncheckedCallArgsChecker which detects a
function argument which is a raw reference or a raw pointer to a CheckedPtr
capable object.
>From 0f32df43d91145c43331b9afb705449bae729523
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/114522
>From 6d45647a0c0452f9132531a654492b73405fba78 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 1 Nov 2024 01:08:35 -0700
Subject: [PATCH] Introduce a new WebKit checker for a unchecked call arguments
(#113
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/114374
>From 474490de53c029ab59008bed9fc33f61db4cb1d7 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 31 Oct 2024 01:12:35 -0700
Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Ignore trivial
functio
@@ -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
rniwa wrote:
> LGTM!
Thanks for the review!
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/rniwa updated
https://github.com/llvm/llvm-project/pull/113708
>From cf5ca301bc9ed2c65eed92e7299bf598d5f88103 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sat, 14 Sep 2024 01:46:23 -0700
Subject: [PATCH 1/2] Introduce a new WebKit checker for a unchecked local
variable
https://github.com/rniwa closed 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/rniwa updated
https://github.com/llvm/llvm-project/pull/114897
>From d08c1b364c392aa42b7ef71528a52ab6a7d9c548 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 4 Nov 2024 16:01:49 -0800
Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Ignore trivial
function
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/108656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/109389
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/110213
Make isUncountedPtr take QualType as an argument instead of Type*. This
simplifies some code.
>From 4c82195acf092fd9a92c999040f8f66947585fde Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 00:
@@ -102,12 +102,13 @@ class UncountedCallArgsChecker
// if ((*P)->hasAttr())
// continue;
-const auto *ArgType = (*P)->getType().getTypePtrOrNull();
-if (!ArgType)
+QualType ArgType = (*P)->getType().getCanonicalType();
+const a
@@ -146,13 +149,67 @@ class NoUncountedMemberChecker
BR->emitReport(std::move(Report));
rniwa wrote:
I'm not calling `setDeclWithIssue` in this checker since the checker works on
classes, and not functions. I guess there could be classes declared within a
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/109389
>From b8f95b5b809cbeb8199de6cd24e18a605189f722 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 19 Sep 2024 23:41:10 -0700
Subject: [PATCH 1/4] WebKit Checkers should set DeclWithIssue.
Set DeclWithIssue in
@@ -53,48 +53,49 @@ hasPublicMethodInBase(const CXXBaseSpecifier *Base, const
char *NameToMatch) {
return hasPublicMethodInBaseClass(R, NameToMatch) ? R : nullptr;
}
-std::optional isRefCountable(const CXXRecordDecl* R)
-{
+std::optional isSmartPtrCompatible(const CXXRecord
@@ -1771,6 +1771,10 @@ def UncountedLambdaCapturesChecker :
Checker<"UncountedLambdaCapturesChecker">,
let ParentPackage = WebKitAlpha in {
+def NoUncheckedPtrMemberChecker : Checker<"NoUncheckedPtrMemberChecker">,
+ HelpText<"Check for no unchecked member variables.">,
+
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/5] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/109393
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -134,18 +135,25 @@ class UncountedLocalVarsChecker
bool shouldVisitTemplateInstantiations() const { return true; }
bool shouldVisitImplicitCode() const { return false; }
+ bool TraverseDecl(Decl *D) {
+llvm::SaveAndRestore SavedDecl(DeclWithIssue);
@@ -102,12 +102,13 @@ class UncountedCallArgsChecker
// if ((*P)->hasAttr())
// continue;
-const auto *ArgType = (*P)->getType().getTypePtrOrNull();
-if (!ArgType)
+QualType ArgType = (*P)->getType().getCanonicalType();
+const a
@@ -56,12 +62,16 @@ class UncountedCallArgsChecker
bool TraverseClassTemplateDecl(ClassTemplateDecl *Decl) {
if (isRefType(safeGetName(Decl)))
return true;
-return RecursiveASTVisitor::TraverseClassTemplateDecl(
-Decl);
+retur
@@ -134,10 +137,10 @@ class NoUncountedMemberChecker
Os << " in ";
printQuotedQualifiedName(Os, ClassCXXRD);
Os << " is a "
- << (isa(MemberType) ? "raw pointer" : "reference")
- << " to ref-countable type ";
+ << (isa(MemberType) ? "raw pointer" :
@@ -0,0 +1,53 @@
+// RUN: %clang_analyze_cc1
-analyzer-checker=alpha.webkit.NoUncheckedPtrMemberChecker -verify %s
+
+#include "mock-types.h"
+#include "mock-system-header.h"
rniwa wrote:
Yeah, I guess we don't need to include "mock-system-header.h" here.
https
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/6] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa edited https://github.com/llvm/llvm-project/pull/108352
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108352
>From ac0447762c98da3cfb41a6b462034e3ab410bc33 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Sep 2024 02:13:12 -0700
Subject: [PATCH 1/7] [alpha.webkit.NoUncheckedPtrMemberChecker] Introduce
member va
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/110213
>From 4c82195acf092fd9a92c999040f8f66947585fde Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 00:07:12 -0700
Subject: [PATCH 1/2] isUncountedPtr should take QualType as an argument.
Make isUnc
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/110222
This PR makes WebKit checkers allow a guardian variable which is CheckedPtr or
CheckedRef as in addition to RefPtr or Ref.
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niw
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/110222
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 02:05:25 -0700
Subject: [PATCH 1/2] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef
This
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/110222
>From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 27 Sep 2024 02:05:25 -0700
Subject: [PATCH 1/3] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef
This
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/108352
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
301 - 400 of 783 matches
Mail list logo