Skip to content

Commit 62770ff

Browse files
committed
Extend region analysis to account for isolated conformances
When a conformance becomes part of a value, and that conformance could potentially be isolated, the value cannot leave that particular isolation domain. For example, if we perform a runtime lookup for a conformance to P as part of a dynamic cast `as? any P`, the conformance to P used in the cast could be isolated. Therefore, it is not safe to transfer the resulting value to another concurrency domain. Model this in region analysis by considering whether instructions that add conformances could end up introducing isolated conformances. In such cases, merge the regions with either the isolation of the conformance itself (if known) or with the region of the task (making them task-isolated). This prevents such values from being sent. Note that `@concurrent` functions, which never dynamically execute on an actor, cannot pick up isolated conformances. Fixes issue #82550 / rdar://154437489
1 parent deec3e1 commit 62770ff

File tree

3 files changed

+433
-23
lines changed

3 files changed

+433
-23
lines changed

0 commit comments

Comments
 (0)