[all-commits] [llvm/llvm-project] a71f9e: [webkit.UncountedLambdaCapturesChecker] Detect pro...

Ryosuke Niwa via All-commits all-commits at lists.llvm.org
Thu Dec 19 18:11:49 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a71f9e6986b80fa90c453219795a1369b8ea7b6e
      https://github.com/llvm/llvm-project/commit/a71f9e6986b80fa90c453219795a1369b8ea7b6e
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2024-12-19 (Thu, 19 Dec 2024)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp
    M clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures.cpp

  Log Message:
  -----------
  [webkit.UncountedLambdaCapturesChecker] Detect protectedThis pattern. (#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 check
for a lambda being passed as a function argument more robust by handling
CXXBindTemporaryExpr, CXXConstructExpr, and DeclRefExpr referring to the
lambda.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list