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/5] WebKit Checkers should set DeclWithIssue.
Set DeclWithIssue in
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/2] WebKit Checkers should set DeclWithIssue.
Set DeclWithIssue in
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/109389
Set DeclWithIssue in alpha.webkit.UncountedCallArgsChecker and
alpha.webkit.UncountedLocalVarsChecker.
>From b8f95b5b809cbeb8199de6cd24e18a605189f722 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 19 Sep
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/3] WebKit Checkers should set DeclWithIssue.
Set DeclWithIssue in
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/109393
This PR fixes a bug in UncountedCallArgsChecker that calling a function with a
member variable which is Ref/RefPtr is erroneously treated as safe by
canoniclizing the type before checking whether it's ref counted
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/110973
This PR fixes the bug that alpha.webkit.UncountedLocalVarsChecker erroneously
treats a trivial recursive function as non-trivial. This was caused by
TrivialFunctionAnalysis::isTrivialImpl which takes a statement
rniwa wrote:
Hm... I'm still hitting a crash. In debug builds, we hit this assertion:
```
Assertion failed: (DD && "queried property of class with no definition"),
function data, file DeclCXX.h, line 452.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and
include the
@@ -1,4 +1,4 @@
-//===- UncountedCallArgsChecker.cpp --*- C++
-*-==//
+//===- RawPtrRefCallArgsChecker.cpp --*- C++
-*-==//
rniwa wrote:
I don't think so. I could imagine `UncountedCallArgsChecker` and
`U
rniwa wrote:
I'm hitting this crash in the checker when I try to compile WebKit with this
patch applied:
```
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH
or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 clang-17 0x00010fb
rniwa wrote:
Thanks for the review!
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
@@ -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/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 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/rniwa closed 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
@@ -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
@@ -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
@@ -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/rniwa approved this pull request.
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/rniwa created
https://github.com/llvm/llvm-project/pull/117090
Only call getThisType() on an instance method.
>From 31481cda425206408eb3aeef844503b110dfaa4d Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Wed, 20 Nov 2024 17:23:18 -0800
Subject: [PATCH] [webkit.UncountedLa
@@ -0,0 +1,132 @@
+//===- 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
@@ -0,0 +1,176 @@
+// RUN: %clang_analyze_cc1
-analyzer-checker=alpha.webkit.MemoryUnsafeCastChecker -verify %s
+
+class Base { };
rniwa wrote:
Can we add tests for static_cast non-pointer types and make sure they don't
emit warnings?
https://github.com/llvm/l
rniwa wrote:
Thanks for the review!
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/rniwa closed 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
@@ -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
@@ -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/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/5] [Webkit Checkers] Treat const member variables as a safe
origin
@@ -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/rniwa closed https://github.com/llvm/llvm-project/pull/108669
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rniwa wrote:
> I'm also somewhat terrified of returning C++ objects from ObjC methods by
> value, ever since I learned that when you call an ObjC method on a nil it
> returns a _zero-initialized_ object without calling a constructor on it.
Yikes. I didn't know that!
https://github.com/llvm/ll
@@ -84,13 +84,22 @@ class DerefFuncDeleteExprVisitor
E = E->IgnoreParenCasts();
if (auto *TempE = dyn_cast(E))
E = TempE->getSubExpr();
+E = E->IgnoreParenCasts();
+if (auto *Ref = dyn_cast(E)) {
+ if (auto *Decl = Ref->getDecl()) {
+if (auto
@@ -84,13 +84,22 @@ class DerefFuncDeleteExprVisitor
E = E->IgnoreParenCasts();
if (auto *TempE = dyn_cast(E))
E = TempE->getSubExpr();
+E = E->IgnoreParenCasts();
+if (auto *Ref = dyn_cast(E)) {
+ if (auto *Decl = Ref->getDecl()) {
+if (auto
@@ -119,6 +119,11 @@ template
ensureOnMainThread([this] {
delete static_cast(this);
});
+} else if constexpr (destructionThread ==
DestructionThread::MainRunLoop) {
+auto deleteThis = [this] {
rniwa w
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/108656
>From e86f101c5cd87db597c5fc8ab017b20adba98284 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Sep 2024 15:19:45 -0700
Subject: [PATCH 1/2] [webkit.RefCntblBaseVirtualDtor] ThreadSafeRefCounted
still ge
https://github.com/rniwa closed 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
rniwa wrote:
Thanks for the review!
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
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/125662
>From f44963f8bd1012ba877d363c9683bb2b03e8eb86 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Tue, 4 Feb 2025 02:02:19 -0800
Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Fix a bug that
the chec
https://github.com/rniwa closed 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
rniwa wrote:
Thanks for the review!
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
https://github.com/rniwa edited 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
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/125662
When a callee is a method call (e.g. calling a lambda), we need to skip the
object pointer to match the parameter list with the call arguments. This
manifests as a bug that the checker erroneously generate a warn
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/126016
We should skip the first argument for CXXOperatorCallExpr, not other kinds of
calls.
>From b4c9048f3f28bd0522338ef7e4498926b66db571 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Wed, 5 Feb 2025 22:48:30 -080
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/126443
In WebKit, it's pretty common to capture "this" and "protectedThis" where
"protectedThis" is a guardian variable of type Ref or RefPtr for "this".
Furthermore, it's common for this "protectedThis" variable from b
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/126443
>From a40e782b866ec4756ddf3f04cc09caff31845ebf Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Sun, 9 Feb 2025 13:50:26 -0800
Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Recognize nested
protec
@@ -368,6 +368,11 @@ class RefCounted {
}
RefPtr trivial66() { return children[0]; }
Ref trivial67() { return *children[0]; }
+ struct point {
+double x;
+double y;
+ };
+ void trivial68() { point pt = { 1.0 }; }
rniwa wrote:
It implicitly ini
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/126353
Like const C++ member variables, treat const Ref, RefPtr, CheckedRef,
CheckedPtr Objective-C ivars as a safe pointer origin in WebKit checkers.
>From b3d79dd62e88afa0e83101165ea878f12176e0f2 Mon Sep 17 00:00:00 2
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/126353
>From b3d79dd62e88afa0e83101165ea878f12176e0f2 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 7 Feb 2025 23:21:06 -0800
Subject: [PATCH 1/2] [WebKit Checkers] Treat const Objective-C ivar as a safe
origin
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/126470
Allow operator T&() in a member function which returns a const member variable.
In particular, this will allow UniqueRef::operator T&() and Ref::operator T&()
to be treated as a safe pointer origin when they're c
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/126203
Implicit value initialization is trivial for our purposes.
>From 717eca92439705bd9f152631a0602fdb7df9413a Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 7 Feb 2025 00:29:41 -0800
Subject: [PATCH] [WebKit
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/126016
>From b4c9048f3f28bd0522338ef7e4498926b66db571 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Wed, 5 Feb 2025 22:48:30 -0800
Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Fix a regression
that [
@@ -63,6 +63,18 @@ template Function
adopt(Detail::Callab
return Function(impl, Function::Adopt);
}
+template
+class HashMap {
+public:
+ HashMap();
+ HashMap([[clang::noescape]] const Function&);
rniwa wrote:
A good point! Added a test case for stati
https://github.com/rniwa closed 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
https://github.com/rniwa commented:
Oh oops, thank you for the fix. It's odd that the checks didn't catch this
before the merge...
https://github.com/llvm/llvm-project/pull/126796
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.l
https://github.com/rniwa closed 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
rniwa wrote:
Thank you for the review!
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
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/119336
Prior to this PR, only CXXTemporaryObjectExpr, not CXXConstructExpr was
recognized in tryToFindPtrOrigin.
>From a3c97276a15af0324b4436d85fa06e22650dfb57 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 9 D
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/119339
___
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/119336
>From a3c97276a15af0324b4436d85fa06e22650dfb57 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 9 Dec 2024 23:03:46 -0800
Subject: [PATCH 1/2] Fix a bug that CXXConstructExpr wasn't recognized by
tryToFindP
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/119681
In WebKit, we often write Foo::ensureBar function which lazily initializes
m_bar and returns a raw pointer or a raw reference to m_bar. Such a return
value is safe to use for the duration of a member function cal
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/120123
This fixes a bug where report links generated from files such as
StylePrimitiveNumericTypes+Conversions.h in WebKit result in an error.
>From ac1fd2653d009760b5cb46a2bf6c5d1c3f52fc41 Mon Sep 17 00:00:00 2001
From
rniwa wrote:
Great. Thanks for the review.
https://github.com/llvm/llvm-project/pull/119800
___
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/119800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rniwa approved this pull request.
https://github.com/llvm/llvm-project/pull/120069
___
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/120123
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rniwa wrote:
Thanks for the review!
https://github.com/llvm/llvm-project/pull/120123
___
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/120195
___
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/120195
Reverts llvm/llvm-project#120123
Broke some tests.
>From b2b261c406108390117e1b6c3fdbe5e9d53a7111 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Mon, 16 Dec 2024 23:35:54 -0800
Subject: [PATCH] =?UTF-8?q?Rever
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/119846
>From 6b4a6b832f61efc26396f60309744c2e7264156d Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Dec 2024 01:49:21 -0800
Subject: [PATCH 1/3] [WebKit checkers] Recognize adoptRef as a safe function
adoptR
@@ -365,3 +365,20 @@ namespace call_with_explicit_temporary_obj {
RefPtr { provide() }->method();
}
}
+
+namespace call_with_adopt_ref {
+ class Obj {
+ public:
+void ref() const;
+void deref() const;
+void method();
+ };
+
+ struct dummy {
+RefPtr any
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/119932
___
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/120528
In WebKit, we often capture this as Ref or RefPtr in addition to this itself so
that the object lives as long as a capturing lambda stays alive.
Detect this pattern and treat it as safe. This PR also makes the ch
@@ -180,11 +212,51 @@ class UncountedLambdaCapturesChecker
} else if (C.capturesThis() && shouldCheckThis) {
if (ignoreParamVarDecl) // this is always a parameter to this function.
continue;
-reportBugOnThisPtr(C);
+bool hasProtectThis =
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/120528
>From 97a721c8358d48333e0f8ab4177906135a2e2364 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Dec 2024 14:34:39 -0800
Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Detect
protectedThis p
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/119846
>From 6b4a6b832f61efc26396f60309744c2e7264156d Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Dec 2024 01:49:21 -0800
Subject: [PATCH 1/4] [WebKit checkers] Recognize adoptRef as a safe function
adoptR
@@ -169,4 +173,42 @@ bool isConstOwnerPtrMemberExpr(const clang::Expr *E) {
return isOwnerPtrType(T) && T.isConstQualified();
}
+class EnsureFunctionVisitor
+: public ConstStmtVisitor {
+public:
+ bool VisitStmt(const Stmt *S) {
+for (const Stmt *Child : S->children
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/119681
>From 0982f5ca3f9d1ea713b1e34b6e6b9d08ff65e6f1 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Dec 2024 01:31:42 -0800
Subject: [PATCH 1/3] [WebKit checkers] Recognize ensureFoo functions
In WebKit, we
rniwa wrote:
Thanks for the review!
https://github.com/llvm/llvm-project/pull/119336
___
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/119336
___
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/119681
>From 0982f5ca3f9d1ea713b1e34b6e6b9d08ff65e6f1 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 12 Dec 2024 01:31:42 -0800
Subject: [PATCH 1/2] [WebKit checkers] Recognize ensureFoo functions
In WebKit, we
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/119800
This PR reintroduces VisitLambdaExpr in LocalVisitor so that lambdas used to
constrcut WTF::Function, for example, would get checked for its lambda captures.
We explicitly ignore lambda used in initializing a Var
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/119681
___
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/119846
adoptRef in WebKit constructs Ref/RefPtr so treat it as such in
isCtorOfRefCounted. Also removed the support for makeRef and makeRefPtr as they
don't exist any more.
>From 6b4a6b832f61efc26396f60309744c2e7264156
@@ -365,3 +365,20 @@ namespace call_with_explicit_temporary_obj {
RefPtr { provide() }->method();
}
}
+
+namespace call_with_adopt_ref {
+ class Obj {
+ public:
+void ref() const;
+void deref() const;
+void method();
+ };
+
+ struct dummy {
+RefPtr any
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/119846
>From 6b4a6b832f61efc26396f60309744c2e7264156d Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Dec 2024 01:49:21 -0800
Subject: [PATCH 1/2] [WebKit checkers] Recognize adoptRef as a safe function
adoptR
@@ -61,6 +62,24 @@ class UncountedLambdaCapturesChecker
return result && *result;
}
+ bool VisitLambdaExpr(LambdaExpr *L) override {
+if (LambdasToIgnore.contains(L))
+ return true;
+Checker->visitLambdaExpr(L, shouldCheckThis());
+
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/119932
In WebKit, we often capture this as Ref or RefPtr in addition to this itself so
that the object lives as long as a capturing lambda stays alive.
Detect this pattern and treat it as safe. This PR also makes the ch
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/119932
>From 5c032267f263fb6b7f10d25745d14e63b2f7af59 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Dec 2024 14:34:39 -0800
Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Detect
protectedThis p
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/119932
>From 5c032267f263fb6b7f10d25745d14e63b2f7af59 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Dec 2024 14:34:39 -0800
Subject: [PATCH 1/3] [webkit.UncountedLambdaCapturesChecker] Detect
protectedThis p
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/120702
___
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/120528
>From 97a721c8358d48333e0f8ab4177906135a2e2364 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Dec 2024 14:34:39 -0800
Subject: [PATCH 1/4] [webkit.UncountedLambdaCapturesChecker] Detect
protectedThis p
https://github.com/rniwa updated
https://github.com/llvm/llvm-project/pull/120528
>From 97a721c8358d48333e0f8ab4177906135a2e2364 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 13 Dec 2024 14:34:39 -0800
Subject: [PATCH 1/3] [webkit.UncountedLambdaCapturesChecker] Detect
protectedThis p
@@ -207,6 +207,58 @@ struct RefCountableWithLambdaCapturingThis {
};
call(lambda);
}
+
+ void method_captures_this_unsafe_capture_local_var_explicitly() {
+RefCountable* x = make_obj();
+call([this, protectedThis = RefPtr { this }, x]() {
+ // expected-w
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/120629
adoptRef in WebKit constructs Ref/RefPtr so treat it as such in
isCtorOfRefCounted.
Also removed the support for makeRef and makeRefPtr as they don't exist any
more.
>From 6b4a6b832f61efc26396f60309744c2e726415
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/120626
Reverts llvm/llvm-project#119846. Introduced a failing test.
>From 274a82ba5fa84333f29d9612deadf53021ee8d8a Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Thu, 19 Dec 2024 11:25:52 -0800
Subject: [PATCH] Rever
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/120626
___
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/119846
___
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/120528
___
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/120702
Added a nullptr check.
>From 527fd23a6bd58cada036fe4a47c13ca93eabf507 Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa
Date: Fri, 20 Dec 2024 01:32:40 -0800
Subject: [PATCH] [webkit.UncountedLambdaCapturesChecker] Fix
https://github.com/rniwa created
https://github.com/llvm/llvm-project/pull/120810
This fixes a bug where report links generated from files such as
StylePrimitiveNumericTypes+Conversions.h in WebKit result in an error.
>From 7da85184e77da5a6d44a8f14ebd3d38d7af493bb Mon Sep 17 00:00:00 2001
From
401 - 500 of 783 matches
Mail list logo