Skip to content

Conversation

rjmccall
Copy link
Contributor

@rjmccall rjmccall commented Sep 9, 2025

The first bug is that we weren't computing isolation correctly for nested defers. This is an unlikely pattern of code, but it's good to fix.

The second bug is that getActorIsolationOfContext was looking through defers, but getActorIsolation itself was not. This was causing defer bodies to be emitted in SILGen without an isolation parameter, which meant that #isolation could not possibly provide the right value. Fixing this involves teaching SILGen that non-async functions can have nonisolated(nonsending) isolation, but that's relatively straightforward (and it's good future-proofing anyway).

The first bug is that we weren't computing isolation correctly for
nested defers. This is an unlikely pattern of code, but it's good to fix.

The second bug is that getActorIsolationOfContext was looking through
defers, but getActorIsolation itself was not. This was causing defer
bodies to be emitted in SILGen without an isolation parameter, which
meant that #isolation could not possibly provide the right value. Fixing
this involves teaching SILGen that non-async functions can have
nonisolated(nonsending) isolation, but that's relatively straightforward.
@rjmccall
Copy link
Contributor Author

rjmccall commented Sep 9, 2025

@swift-ci Please test

@rjmccall
Copy link
Contributor Author

rjmccall commented Sep 9, 2025

Superceded by #84181.

@rjmccall rjmccall closed this Sep 9, 2025
@rjmccall rjmccall deleted the defer-isolation branch September 9, 2025 18:40
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.

2 participants