Skip to content

Generic super capture fix (2.2) #2004

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

Conversation

slavapestov
Copy link
Contributor

This fixes rdar://25439564, a Swift 2.2 regression where a crash could occur while compiling a closure satisfying a very specific set of conditions detailed in the bug report and tests.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

Oops, forgot to add CHECKs to the tests. Don't review just yet.

@slavapestov slavapestov force-pushed the generic-super-capture-fix-2.2 branch from 9af6953 to 1eee149 Compare April 1, 2016 04:28
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@jckarter Do you mind reviewing this?

@slavapestov slavapestov added this to the Swift 2.2.x milestone Apr 1, 2016
…generic signature

Otherwise, we can miss that 'self' has a generic type when accessed
via a 'super' call if the type of 'super' is concrete.

This is a regression from a patch series to allow C function pointers
to be formed from closures in generic contexts -- basically, the
check was not conservative enough, and in this case, it would
conclude the closure did not capture the generic signature when
in reality it did:

swiftlang@533f42d

Fixes <rdar://problem/25439564>.
@slavapestov slavapestov force-pushed the generic-super-capture-fix-2.2 branch from 1eee149 to 908fae0 Compare April 1, 2016 05:22
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@tkremenek Please take a look once @jckarter signs off on this

@jckarter
Copy link
Contributor

jckarter commented Apr 1, 2016

Nice catch, LGTM. Is master also affected?

@tkremenek tkremenek merged commit 1c7fa7e into swiftlang:swift-2.2-branch Apr 1, 2016
@slavapestov
Copy link
Contributor Author

Yeah, I'm going to push the fix to master shortly.

@slavapestov slavapestov deleted the generic-super-capture-fix-2.2 branch April 8, 2016 09:51
MaxDesiatov pushed a commit that referenced this pull request Oct 19, 2020
[pull] swiftwasm from main
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.

3 participants