Skip to content

Conversation

@egorzhdan
Copy link
Contributor

When importing C++ methods, Swift always assumes that methods named `begin()` and `end()` are unsafe, since these methods commonly return iterator types that are inherently unsafe in Swift.

Some additional logic in Sema tries to diagnose usages of `.begin()` and `.end()` from Swift and suggest safe alternatives. That logic had a null pointer dereference bug.

rdar://153814676 / resolves #82361
(cherry picked from commit 883ff18)
@egorzhdan egorzhdan requested a review from a team as a code owner July 1, 2025 16:41
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jul 1, 2025
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan
Copy link
Contributor Author

@swift-ci please test macOS

2 similar comments
@egorzhdan
Copy link
Contributor Author

@swift-ci please test macOS

@egorzhdan
Copy link
Contributor Author

@swift-ci please test macOS

@egorzhdan egorzhdan merged commit fc0c350 into release/6.2 Jul 2, 2025
5 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/6.2-void-begin-crash branch July 2, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ interop Feature: Interoperability with C++

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants