Skip to content

EscapeUtils: add test cases and an assert for addresses escaping to to a closure #63864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

eeckstein
Copy link
Contributor

It's essential that a non-escaping closure will be treated as having a relevant type for escape analysis. Because if it's capturing an (inout) address it's like it's storing a pointer to the captured variable in its context.

Adds test cases for rdar://105676825

…o a closure

It's essential that a non-escaping closure will be treated as having a relevant type for escape analysis.
Because if it's capturing an (inout) address it's like it's storing a pointer to the captured variable in its context.

Adds test cases for rdar://105676825
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein eeckstein merged commit f89c11a into swiftlang:main Feb 24, 2023
@eeckstein eeckstein deleted the fix-escape-addr-to-partial-apply branch February 24, 2023 09:30
@finagolfin
Copy link
Member

@eeckstein, it appears this new case breaks a test on the Android armv7 CI and probably other 32-bit platforms like watchOS too:

Command Output (stderr):
--
SIL verification failed: struct operand type does not match field type
  $Builtin.Int64
  $Builtin.Int32
Verifying instruction:
     %1 = integer_literal $Builtin.Int64, 0       // user: %2
->   %2 = struct $Int (%1 : $Builtin.Int64)       // user: %5
     store %2 to %0 : $*Int                       // id: %5
In function:
// test_closure_capturing_address

These 32-bit platforms are probably not that important anymore, but if you know a quick fix, please let me know.

@eeckstein
Copy link
Contributor Author

@buttaface Thanks! This should fix it: #63932

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