Skip to content

Conversation

@rniwa
Copy link

@rniwa rniwa commented Oct 16, 2025

Merge WebKit static analysis fixes as of 2025-10-16.

rniwa and others added 13 commits October 16, 2025 00:51
…s::all_of as [[clang::noescape]] (llvm#158419)

The checker already had std::ranges hard-coded to treat its arguments as
[[clang::oescape]] but the fact std::ranges::all_of is implemented as a
struct instead of a function confused the checker and resuled in a
superflous warning being emitted for std::ranges::all_of.

This PR adds the support for recognizing DeclRefExpr which appears as a
callee in VisitCallExpr and generalizes the check in
shouldTreatAllArgAsNoEscape to walk up the decl contexts to find the
target namespaces such as std::ranges:: or a namespace and a function
like WTF::switchOn.

(cherry picked from commit 725d9e8)
Add the support for OSObjectPtr, which behaves like RetainPtr.

(cherry picked from commit 9d933c7)
…mplementation is seen (llvm#159947)

A @interface declaration with a raw pointer @Property does not
necessarily mean it synthesizes ivar of that type. To determine whether
such a synthesis happens or not, we must wait for @implementation to
appear. So this PR makes the checker only validate @Property then.

(cherry picked from commit 321a7c3)
llvm#160986)

Allow leakRef() in the return statement of an Objective-C copy method
and other methods which return +1.

(cherry picked from commit 103d2ca)
)

Treat accessing NSApp without retaining it as safe

(cherry picked from commit 872c431)
…ynthesis (llvm#162576)

Don't emit a warning when an Objective-C property is defined using copy
or strong semantics.

(cherry picked from commit b7e256d)
Recognize ns_returns_autoreleased on a function and treat its return
value as a safe pointer origin.

(cherry picked from commit 0e4fb17)
…nd alike as trivial and returns a retained value (llvm#161135)

Treat NSStringFromSelector, NSSelectorFromString, NSStringFromClass,
NSClassFromString, NSStringFromProtocol, and NSProtocolFromString as
trivial, and treat their return values as a safe pointer origin since
the return value of these functions don't need to be retained.

(cherry picked from commit b626282)
…g a parameter (llvm#160994)

This PR updates the forward declaration checker so that unary operator &
and * will be ignored for the purpose of determining if a given function
argument is also a function argument of the caller / call-site.

(cherry picked from commit e61e625)
@adrian-prantl
Copy link

@swift-ci test

@adrian-prantl
Copy link

@swift-ci test windows

@adrian-prantl adrian-prantl merged commit bfc5e0a into swiftlang:stable/21.x Oct 17, 2025
3 checks passed
@rniwa rniwa deleted the merge-webkit-fixes-2025-10-16 branch October 17, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants