[clang] [webkit.UncountedLambdaCapturesChecker] Fix a nullptr deference. (PR #120702)

2024-12-20 Thread Ryosuke Niwa via cfe-commits
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

[clang] [WebKit checkers] Recognize adoptRef as a safe function (PR #120629)

2024-12-19 Thread Ryosuke Niwa via 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

[clang] [webkit.UncountedLambdaCapturesChecker] Detect protectedThis pattern. (PR #120528)

2024-12-19 Thread Ryosuke Niwa via 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

[clang] [Webkit Checkers] Introduce a Webkit checker for memory unsafe casts (PR #114606)

2024-11-21 Thread Ryosuke Niwa via cfe-commits
@@ -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

[clang] [Webkit Checkers] Introduce a Webkit checker for memory unsafe casts (PR #114606)

2024-11-21 Thread Ryosuke Niwa via cfe-commits
@@ -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

[clang] [webkit.UncountedLambdaCapturesChecker] Fix debug assertion failure. (PR #117090)

2024-11-21 Thread Ryosuke Niwa via cfe-commits
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

[clang] [webkit.UncountedLambdaCapturesChecker] Fix debug assertion failure. (PR #117090)

2024-11-21 Thread Ryosuke Niwa via 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

[clang] [webkit.UncountedLambdaCapturesChecker] Ignore lambda invocation with arguments (PR #117394)

2024-11-22 Thread Ryosuke Niwa via 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

[clang] [webkit.UncountedLambdaCapturesChecker] Ignore lambda invocation with arguments (PR #117394)

2024-11-22 Thread Ryosuke Niwa via cfe-commits
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

[clang] [webkit.UncountedLambdaCapturesChecker] Ignore lambda invocation with arguments (PR #117394)

2024-11-22 Thread Ryosuke Niwa via 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

[clang] [Static analysis] Encodes a filename before inserting it into a URL. (PR #120810)

2025-01-17 Thread Ryosuke Niwa via cfe-commits
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

[clang] [webkit.UncountedLambdaCapturesChecker] Recognize nested protectedThis pattern (PR #126443)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/126443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Treat attributes as trivial (PR #127289)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/127289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Treat attributes as trivial (PR #127289)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the quick review! https://github.com/llvm/llvm-project/pull/127289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.UncountedLambdaCapturesChecker] Recognize nested protectedThis pattern (PR #126443)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
@@ -299,6 +300,29 @@ struct RefCountableWithLambdaCapturingThis { return obj->next(); }); } + + void callAsyncNoescape([[clang::noescape]] WTF::Function&&); + void method_temp_lambda(RefCountable* obj) { +callAsyncNoescape([this, otherObj = RefPtr { obj }](au

[clang] [WebKit Checkers] Treat offsetof as a trivial expression. (PR #126996)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/126996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.UncountedLambdaCapturesChecker] Recognize nested protectedThis pattern (PR #126443)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
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/3] [webkit.UncountedLambdaCapturesChecker] Recognize nested protec

[clang] [webkit.UncountedLambdaCapturesChecker] Recognize nested protectedThis pattern (PR #126443)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
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/4] [webkit.UncountedLambdaCapturesChecker] Recognize nested protec

[clang] [webkit.UncountedLambdaCapturesChecker] Recognize nested protectedThis pattern (PR #126443)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/126443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Treat attributes as trivial (PR #127289)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/127289 For the purpose of determining triviality, ignore all attributes. >From 31e0fcbf7f8bf4d2244c863041df3716a598db3f Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Wed, 12 Feb 2025 22:16:11 -0800 Subject: [PATCH]

[clang] [webkit.UncountedLambdaCapturesChecker] Recognize nested protectedThis pattern (PR #126443)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
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/3] [webkit.UncountedLambdaCapturesChecker] Recognize nested protec

[clang] [alpha.webkit.UncountedCallArgsChecker] Allow ArrayInitLoopExpr and OpaqueValueExpr in trivial expressions (PR #127182)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s rniwa wrote: Added a non-trivial test case. https://github.com/llvm/llvm-project/pull/127182 ___ cfe-comm

[clang] [webkit.UncountedLambdaCapturesChecker] Support [[clang::noescape]] on a constructor (PR #126869)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
@@ -106,6 +107,26 @@ class UncountedLambdaCapturesChecker return safeGetName(NsDecl) == "WTF" && safeGetName(Decl) == "switchOn"; } + bool VisitCXXConstructExpr(CXXConstructExpr *CE) override { +if (ConstructToIgnore.contains(CE)) + return t

[clang] [webkit.UncountedLambdaCapturesChecker] Recognize nested protectedThis pattern (PR #126443)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
@@ -299,6 +300,29 @@ struct RefCountableWithLambdaCapturingThis { return obj->next(); }); } + + void callAsyncNoescape([[clang::noescape]] WTF::Function&&); + void method_temp_lambda(RefCountable* obj) { +callAsyncNoescape([this, otherObj = RefPtr { obj }](au

[clang] [webkit.UncountedLambdaCapturesChecker] Recognize nested protectedThis pattern (PR #126443)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
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

[clang] [alpha.webkit.UncountedCallArgsChecker] Allow ArrayInitLoopExpr and OpaqueValueExpr in trivial expressions (PR #127182)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s rniwa wrote: We have tests for non-trivial expressions: clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp. I guess we can add a test case he

[clang] [webkit.UncountedLambdaCapturesChecker] Support [[clang::noescape]] on a constructor (PR #126869)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa edited https://github.com/llvm/llvm-project/pull/126869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Treat offsetof as a trivial expression. (PR #126996)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/126996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.UncountedLambdaCapturesChecker] Support [[clang::noescape]] on a constructor (PR #126869)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/126869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.UncountedLambdaCapturesChecker] Support [[clang::noescape]] on a constructor (PR #126869)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/126869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncountedCallArgsChecker] Allow ArrayInitLoopExpr and OpaqueValueExpr in trivial expressions (PR #127182)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/127182 >From 2be47498ca7597748ee8b29f5d39d74608c2f4d3 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 14 Feb 2025 00:48:36 -0800 Subject: [PATCH 1/3] [alpha.webkit.UncountedCallArgsChecker] Allow ArrayInitLoopExp

[clang] [webkit.UncountedLambdaCapturesChecker] Recognize nested protectedThis pattern (PR #126443)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
@@ -299,6 +300,29 @@ struct RefCountableWithLambdaCapturingThis { return obj->next(); }); } + + void callAsyncNoescape([[clang::noescape]] WTF::Function&&); + void method_temp_lambda(RefCountable* obj) { +callAsyncNoescape([this, otherObj = RefPtr { obj }](au

[clang] [alpha.webkit.UncountedCallArgsChecker] Allow ArrayInitLoopExpr and OpaqueValueExpr in trivial expressions (PR #127182)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/127182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncountedCallArgsChecker] Allow ArrayInitLoopExpr and OpaqueValueExpr in trivial expressions (PR #127182)

2025-02-14 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/127182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.UncountedLambdaCapturesChecker] Fix a crash in declProtectsThis (PR #127309)

2025-02-15 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the timely review! https://github.com/llvm/llvm-project/pull/127309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.UncountedLambdaCapturesChecker] Fix a crash in declProtectsThis (PR #127309)

2025-02-15 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/127309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Allow operator T&() in a const member function (PR #126470)

2025-02-11 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/126470 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Allow operator T&() in a const member function (PR #126470)

2025-02-11 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/126470 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.UncountedLambdaCapturesChecker] Fix a crash in declProtectsThis (PR #127309)

2025-02-15 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/127309 Add a missing nullptr check to declProtectsThis. >From 715da2e5ec5cd64416a5dab9017a9c43a6ca8e78 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 15 Feb 2025 01:33:47 -0800 Subject: [PATCH] [webkit.Uncounted

[clang] [webkit.UncountedLambdaCapturesChecker] Fix a crash in declProtectsThis (PR #127309)

2025-02-15 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/127309 >From 715da2e5ec5cd64416a5dab9017a9c43a6ca8e78 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 15 Feb 2025 01:33:47 -0800 Subject: [PATCH 1/2] [webkit.UncountedLambdaCapturesChecker] Fix a crash in declPro

[clang] [alpha.webkit.UncountedCallArgsChecker] Treat an explicit construction of Ref from a Ref return value safe. (PR #130911)

2025-03-15 Thread Ryosuke Niwa via cfe-commits
@@ -70,6 +70,8 @@ bool tryToFindPtrOrigin( if (isCtorOfSafePtr(ConversionFunc)) return callback(E, true); } +if (isa(E) && isSafePtrType(cast->getType())) + return callback(E, true); rniwa wrote: We typically don'

[clang] [alpha.webkit.UncountedCallArgsChecker] Fix a false negative when a call argument is a local variable. (PR #129974)

2025-03-15 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: On hindsight, the existing code is correct. We're lying on local variable checker to check the liveness of a local variable. Call arguments checker was just relying on that. https://github.com/llvm/llvm-project/pull/129974 ___ cfe-commit

[clang] [alpha.webkit.UncountedCallArgsChecker] os_log functions should be treated as safe. (PR #131500)

2025-03-15 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/131500 …os_log functions should be treated as safe in call arguments checkers. Also treat __builtin_* functions and __libcpp_verbose_abort functions as "trivial" for the purpose in call argument checkers. >From 38660de

[clang] Skip more WebKit checker tests on targets where builtin is not supported. (PR #131501)

2025-03-15 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/131501 None >From a03593710d4c39b484490573d257162742c83ca1 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 15 Mar 2025 23:11:03 -0700 Subject: [PATCH] Skip more WebKit checker tests on targets where builtin is n

[clang] Skip more WebKit checker tests on targets where builtin is not supported. (PR #131501)

2025-03-15 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/131501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf (PR #132363)

2025-03-22 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/132363 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] Support adopt(cast(copy(~)) (PR #132316)

2025-03-20 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/132316 >From 642057c409b1c3b98ee4ecb16e95b5fb5be47a01 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Thu, 20 Mar 2025 17:54:22 -0700 Subject: [PATCH 1/2] [alpha.webkit.RetainPtrCtorAdoptChecker] Support adopt(cast(co

[clang] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf (PR #132363)

2025-03-21 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/132363 This PR adds the support for treating capturing of "self" as safe if the lambda simultaneously captures "protectedSelf", which is a RetainPtr of "self". This PR also fixes a bug that the checker wasn't generating

[clang] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf (PR #132363)

2025-03-21 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/132363 >From cf415a9cf9933bc4e55d3c8da9b27551b09061fe Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 21 Mar 2025 02:32:49 -0700 Subject: [PATCH 1/2] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support

[clang] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf (PR #132363)

2025-03-21 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/132363 >From cf415a9cf9933bc4e55d3c8da9b27551b09061fe Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 21 Mar 2025 02:32:49 -0700 Subject: [PATCH 1/3] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support

[clang] [webkit.RefCntblBaseVirtualDtor] Add support for NoVirtualDestructorBase. (PR #132497)

2025-03-21 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/132497 This PR adds the support for WTF::NoVirtualDestructorBase, which signifies to the checker that the class is exempt from having a virtual destructor. >From a49c213d2ccb82391eb6e550d440ef4e829ecfa8 Mon Sep 17 00:00

[clang] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf (PR #132518)

2025-03-21 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/132518 This PR adds the support for treating capturing of "self" as safe if the lambda simultaneously captures "protectedSelf", which is a RetainPtr of "self". This PR also fixes a bug that the checker wasn't generating

[clang] [alpha.webkit.UncountedCallArgsChecker] os_log functions should be treated as safe. (PR #131500)

2025-03-17 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/131500 >From 38660deefa24a6014d60c63428b45006d18a1488 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 15 Mar 2025 23:02:55 -0700 Subject: [PATCH 1/2] [alpha.webkit.UncountedCallArgsChecker] os_log functions shoul

[clang] [alpha.webkit.UncountedCallArgsChecker] os_log functions should be treated as safe. (PR #131500)

2025-03-17 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/131500 >From 38660deefa24a6014d60c63428b45006d18a1488 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 15 Mar 2025 23:02:55 -0700 Subject: [PATCH 1/3] [alpha.webkit.UncountedCallArgsChecker] os_log functions shoul

[clang] [alpha.webkit.UncountedCallArgsChecker] os_log functions should be treated as safe. (PR #131500)

2025-03-17 Thread Ryosuke Niwa via cfe-commits
@@ -695,9 +695,13 @@ RefPtr object(); void someFunction(const RefCounted&); void test2() { -someFunction(*object()); + someFunction(*object()); } void system_header() { callMethod(object); } + +void log(RefCountable* obj) { + os_log_msg(os_log_create("WebKit", "D

[clang] [alpha.webkit.ForwardDeclChecker] Ignore forward declared struct. (PR #133804)

2025-04-04 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/133804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.ForwardDeclChecker] Recognize a forward declared template specialization (PR #134545)

2025-04-06 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/134545 This PR fixes a bug that when a template specialization is declared with a forward declaration of a template, the checker fails to find its definition in the same translation unit and erroneously emit an unsafe f

[clang] [alpha.webkit.ForwardDeclChecker] Recognize a forward declared template specialization (PR #134545)

2025-04-06 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/134545 >From a6c4a36a0c7a9b24e0f44748f3d92eee013ab645 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sun, 6 Apr 2025 09:26:33 -0700 Subject: [PATCH 1/2] [alpha.webkit.ForwardDeclChecker] Recognize a forward declared

[clang] [alpha.webkit.UncountedCallArgsChecker] os_log functions should be treated as safe. (PR #131500)

2025-04-05 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/131500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix the assertion failure in Analysis/Checkers/WebKit/forward-decl-checker.mm after https://github.com/llvm/llvm-project/pull/132784. (PR #133341)

2025-04-05 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/133341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.NoUnretainedMemberChecker] Ignore system-header-defined ivar / property of a forward declared type (PR #133755)

2025-04-05 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/133755 >From 0fb864bc5ae7d2b58879a6ad59babffe722bbf72 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 31 Mar 2025 10:11:10 -0700 Subject: [PATCH 1/2] [alpha.webkit.NoUnretainedMemberChecker] Ignore system-header-

[clang] [alpha.webkit.ForwardDeclChecker] Ignore forward declared struct. (PR #133804)

2025-04-05 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/133804 >From f5d2ab90f34cf2d7323e9c3c2e37680c35f411d6 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 31 Mar 2025 14:38:22 -0700 Subject: [PATCH 1/2] [alpha.webkit.ForwardDeclChecker] Ignore forward declared stru

[clang] [WebKit checkers] Treat Objective-C message send return value as safe (PR #133605)

2025-04-05 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/133605 Objective-C selectors are supposed to return autoreleased object. Treat these return values as safe. >From 02340f3d1f51ae69598a8725403d4835f29f17cd Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 29 Mar 2

[clang] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf (PR #132518)

2025-04-05 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa unassigned https://github.com/llvm/llvm-project/pull/132518 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.RawPtrRefMemberChecker] The checker doesn't warn Objective-C types in ivars. (PR #132833)

2025-03-26 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/132833 This PR fixes the bug that we weren't generating warnings when a raw poiner is used to point to a NS type in Objective-C ivars. Also fix the bug that we weren't suppressing this warning in system headers. >From

[clang] [webkit.RefCntblBaseVirtualDtor] Add support for NoVirtualDestructorBase. (PR #132497)

2025-03-26 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thank you for the review! https://github.com/llvm/llvm-project/pull/132497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.RefCntblBaseVirtualDtor] Add support for NoVirtualDestructorBase. (PR #132497)

2025-03-26 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/132497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.RawPtrRefMemberChecker] The checker doesn't warn Objective-C types in ivars. (PR #132833)

2025-03-26 Thread Ryosuke Niwa via cfe-commits
@@ -58,3 +59,11 @@ void forceTmplToInstantiate(FooTmpl) {} void forceTmplToInstantiate(RefPtr) {} } + +@interface AnotherObject : NSObject { + NSString *ns_string; + // expected-warning@-1{{Instance variable 'ns_string' in 'AnotherObject' is a raw pointer to retainable ty

[clang] [WebKit Checkers] Recognize Objective-C and CF pointer conversion functions. (PR #132784)

2025-03-27 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/132784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Recognize Objective-C and CF pointer conversion functions. (PR #132784)

2025-03-27 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/132784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Recognize Objective-C and CF pointer conversion functions. (PR #132784)

2025-03-27 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Oops, fixing this in https://github.com/llvm/llvm-project/pull/133341. https://github.com/llvm/llvm-project/pull/132784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix the assertion failure in Analysis/Checkers/WebKit/forward-decl-checker.mm after https://github.com/llvm/llvm-project/pull/132784. (PR #133341)

2025-03-27 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/133341 None >From 13115c0d14953c01dba10c4fbb38e149acce6c34 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Thu, 27 Mar 2025 16:24:23 -0700 Subject: [PATCH] Fix the assertion failure in Analysis/Checkers/WebKit/forwar

[clang] [WebKit Checkers] Recognize Objective-C and CF pointer conversion functions. (PR #132784)

2025-03-27 Thread Ryosuke Niwa via cfe-commits
@@ -273,11 +279,148 @@ inline CFTypeRef bridge_cast(NSObject *object) return (__bridge CFTypeRef)object; } +template +struct ObjCTypeCastTraits { +public: +static bool isType(id object) { return [object isKindOfClass:[ExpectedType class]]; } + +template +sta

[clang] [WebKit Checkers] Recognize Objective-C and CF pointer conversion functions. (PR #132784)

2025-03-27 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/132784 >From aed6967708809b964c4969ec4e6477dade61132d Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 24 Mar 2025 10:13:16 -0700 Subject: [PATCH 1/2] [WebKit Checkers] Recognize Objective-C and CF pointer convers

[clang] [WebKit Checkers] Recognize Objective-C and CF pointer conversion functions. (PR #132784)

2025-03-27 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa edited https://github.com/llvm/llvm-project/pull/132784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Recognize Objective-C and CF pointer conversion functions. (PR #132784)

2025-03-27 Thread Ryosuke Niwa via cfe-commits
@@ -273,11 +279,148 @@ inline CFTypeRef bridge_cast(NSObject *object) return (__bridge CFTypeRef)object; } +template +struct ObjCTypeCastTraits { +public: +static bool isType(id object) { return [object isKindOfClass:[ExpectedType class]]; } + +template +sta

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] Recognize mutableCopy from literal as +1 (PR #132350)

2025-04-08 Thread Ryosuke Niwa via cfe-commits
@@ -97,3 +97,13 @@ void create_member_init() { RetainPtr return_bridge_cast() { return bridge_cast(create_cf_array()); } + +void mutable_copy() { + RetainPtr mutableArray = adoptNS(@{ +@"Content-Type": @"text/html", + }.mutableCopy); +} + +void string_copy(NSString *str

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] Support adopt(cast(copy(~)) (PR #132316)

2025-04-09 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/132316 >From 642057c409b1c3b98ee4ecb16e95b5fb5be47a01 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Thu, 20 Mar 2025 17:54:22 -0700 Subject: [PATCH 1/3] [alpha.webkit.RetainPtrCtorAdoptChecker] Support adopt(cast(co

[clang] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf (PR #132518)

2025-04-09 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/132518 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf (PR #132518)

2025-04-09 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/132518 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] Recognize mutableCopy from literal as +1 (PR #132350)

2025-04-09 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/132350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf (PR #132518)

2025-04-09 Thread Ryosuke Niwa via cfe-commits
@@ -448,6 +483,10 @@ class UnretainedLambdaCapturesChecker : public RawPtrRefLambdaCapturesChecker { return RTC->isUnretained(QT); } + virtual bool isPtrType(const std::string &Name) const final { rniwa wrote: Yes, line 290 / 300 and line 318 / 334.

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] Recognize mutableCopy from literal as +1 (PR #132350)

2025-04-09 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/132350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.NoUnretainedMemberChecker] Ignore system-header-defined ivar / property of a forward declared type (PR #133755)

2025-03-31 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/133755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.RawPtrRefMemberChecker] The checker doesn't warn Objective-C types in ivars. (PR #132833)

2025-03-28 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/132833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.RawPtrRefMemberChecker] The checker doesn't warn Objective-C types in ivars. (PR #132833)

2025-03-28 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/132833 >From ca50deea7d8096b065d2bf7aa5e007afc8f0a954 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 24 Mar 2025 14:22:28 -0700 Subject: [PATCH 1/4] [alpha.webkit.RawPtrRefMemberChecker] The checker doesn't warn

[clang] [alpha.webkit.ForwardDeclChecker] Ignore forward declared struct. (PR #133804)

2025-03-31 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/133804 There are some system libraries such as sqlite3 which forward declare a struct then use a pointer to that forward declared type in various APIs. Ignore these types ForwardDeclChecker like other pointer types. >F

[clang] [alpha.webkit.ForwardDeclChecker] Ignore forward declared struct. (PR #133804)

2025-03-31 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/133804 >From f5d2ab90f34cf2d7323e9c3c2e37680c35f411d6 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 31 Mar 2025 14:38:22 -0700 Subject: [PATCH 1/3] [alpha.webkit.ForwardDeclChecker] Ignore forward declared stru

[clang] [alpha.webkit.NoUnretainedMemberChecker] Ignore system-header-defined ivar / property of a forward declared type (PR #133755)

2025-03-31 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the quick review! https://github.com/llvm/llvm-project/pull/133755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncountedCallArgsChecker] os_log functions should be treated as safe. (PR #131500)

2025-03-17 Thread Ryosuke Niwa via cfe-commits
@@ -695,9 +695,13 @@ RefPtr object(); void someFunction(const RefCounted&); void test2() { -someFunction(*object()); + someFunction(*object()); } void system_header() { callMethod(object); } + +void log(RefCountable* obj) { + os_log_msg(os_log_create("WebKit", "D

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] An assortment of small enhancements (PR #135329)

2025-04-11 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/135329 >From ffeb0f6f3252579fe77460ba05b57f7b68189bab Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 11 Apr 2025 01:15:55 -0700 Subject: [PATCH 1/2] [alpha.webkit.RetainPtrCtorAdoptChecker] An assortment of smal

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] An assortment of small enhancements (PR #135329)

2025-04-11 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/135329 >From ffeb0f6f3252579fe77460ba05b57f7b68189bab Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 11 Apr 2025 01:15:55 -0700 Subject: [PATCH 1/3] [alpha.webkit.RetainPtrCtorAdoptChecker] An assortment of smal

[clang] [webkit.UncountedLambdaCapturesChecker] Treat a call to lambda function via a variable as safe. (PR #135688)

2025-04-14 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/135688 This PR makes the checker ignore a function call to lambda via a local variable. >From 41992e5ffb43f7db7704b93c7ad5fe2135e86e26 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Mon, 14 Apr 2025 15:12:10 -0700 Su

[clang] [alpha.webkit.UnretainedCallArgsChecker] Don't emit a warning for RetainPtr::operator= (PR #135526)

2025-04-14 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/135526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RawPtrRefMemberChecker] Member varible checker should allow T* in smart pointer classes (PR #136503)

2025-04-20 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/136503 This PR fixes member variable checker to allow the usage of T* in smart pointer classes. e.g. alpha.webkit.NoUncheckedPtrMemberChecker should allow T* to appear within RefPtr. >From 441e1d80180549ff17eb74e3749bc

[clang] [RawPtrRefMemberChecker] Member varible checker should allow T* in smart pointer classes (PR #136503)

2025-04-20 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/136503 >From 01a0a5544010a605e828a28c04ba56d37658c6b0 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sun, 20 Apr 2025 11:58:11 -0700 Subject: [PATCH] [RawPtrRefMemberChecker] Member variable checker should allow T* i

[clang] [RawPtrRefMemberChecker] Member variable checker should allow T* in smart pointer classes (PR #136503)

2025-04-20 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa edited https://github.com/llvm/llvm-project/pull/136503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [alpha.webkit.UncheckedCallArgsChecker] Checker fails to recognize CanMakeCheckedPtrBase (PR #136500)

2025-04-20 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/136500 This PR fixes the bug that alpha.webkit.UncheckedCallArgsChecker did not recognize CanMakeCheckedPtrBase due to getAsCXXRecordDecl returning nullptr for it in hasPublicMethodInBase. Manually grab getTemplatedDecl

[clang] [WebKit checkers] Treat global const variables as safe (PR #136170)

2025-04-17 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/136170 This PR makes WebKit checkers treat a variable with global storage as safe instead of constraining to ones that start with k or _k. >From e051846bf5eeb0a6b4f701096e2d461b2c11254d Mon Sep 17 00:00:00 2001 From: Ry

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] An assortment of small enhancements (PR #135329)

2025-04-27 Thread Ryosuke Niwa via cfe-commits
rniwa wrote: Oops, fixing the assertion failure in https://github.com/llvm/llvm-project/pull/137556. https://github.com/llvm/llvm-project/pull/135329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

<    1   2   3   4   5   6   7   8   >