https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/120810
___
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/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
rniwa wrote:
Thanks for the review!
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 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 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 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
rniwa wrote:
Thanks for the review
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 closed https://github.com/llvm/llvm-project/pull/120629
___
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 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 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/119846
___
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/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
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
@@ -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 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
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 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/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 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 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
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/119800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
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 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 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 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
@@ -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 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
@@ -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 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
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/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 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
@@ -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/2] [WebKit checkers] Recognize ensureFoo functions
In WebKit, we
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
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 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 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 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 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/117394
___
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/117394
___
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/117394
Fixed a bug that UncountedLambdaCapturesChecker would emit a warning on a
lambda capture when the lambda is invoked with arguments.
LocalVisitor::VisitCallExpr was not tolerating a lambda invocation with more
th
@@ -0,0 +1,185 @@
+//===- 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,185 @@
+//===- 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 closed https://github.com/llvm/llvm-project/pull/117090
___
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/117090
___
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,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
@@ -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
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
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
@@ -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 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
@@ -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
@@ -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
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 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
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 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/2] [Webkit Checkers] Treat const member variables as a safe
origin
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/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
@@ -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
@@ -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/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/2] [webkit.UncountedLambdaCapturesChecker] Ignore trivial
function
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 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 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
@@ -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
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
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
@@ -1,4 +1,4 @@
-//===- UncountedCallArgsChecker.cpp --*- C++
-*-==//
+//===- RawPtrRefCallArgsChecker.cpp --*- C++
-*-==//
rniwa wrote:
I don't think so. I could imagine `UncountedCallArgsChecker` and
`U
@@ -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 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
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
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
@@ -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 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
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
@@ -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
@@ -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
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/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 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 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/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
1 - 100 of 492 matches
Mail list logo