Skip to content

Conversation

@cachemeifyoucan
Copy link
Contributor

@cachemeifyoucan cachemeifyoucan commented Oct 16, 2025

Fix new clang warnings that can indicate potential use-after-free from
dangling pointers.

The issues are mostly coming from llvm::function_ref are not owning
the function, and std::function should be used in those cases.

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan
Copy link
Contributor Author

ping

@cachemeifyoucan cachemeifyoucan changed the title Fix warning -Wdangling-assignment-gsl in SIL/PrunedLiveness.h Fix -Wdangling-assignment-gsl warnings Oct 20, 2025
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

return unboundTyOpener;
}

static Type defaultUnbountTypeOpener(UnboundGenericType *ty) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static Type defaultUnbountTypeOpener(UnboundGenericType *ty) {
static Type defaultUnboundTypeOpener(UnboundGenericType *ty) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good typo catch.

Fix new clang warnings that can indicate potential use-after-free from
dangling pointers.

The issues are mostly coming from `llvm::function_ref` are not owning
the function, and `std::function` should be used in those cases.
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test windows platform

@cachemeifyoucan cachemeifyoucan merged commit cb7ddbe into swiftlang:main Oct 21, 2025
3 checks passed
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.

5 participants