Skip to content
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

SILGen: Fix no escape verification if the closure throws an exception #17067

Conversation

Projects
None yet
1 participant
@aschwaighofer
Copy link
Member

aschwaighofer commented Jun 8, 2018

It is safe to omit the retain/release dance in the reabstraction thunk
because we know we have an aditional reference outstanding for the
is_escaping verification.

The problem with throwing an objc exception inside a noescape closure is
that we verify the reference count of the closure sentinel. The
reabstraction thunk would increase the reference count call the
implementation function that then throws skipping the decrement.

rdar://40857699

SILGen: Fix no escape verification if the closure throws an exception
It is safe to omit the retain/release dance in the reabstraction thunk
because we know we have an aditional reference outstanding for the
is_escaping verification.

The problem with throwing an objc exception inside a noescape closure is
that we verify the reference count of the closure sentinel. The
reabstraction thunk would increase the reference count call the
implementation function that then throws skipping the decrement.

rdar://40857699
@aschwaighofer

This comment has been minimized.

Copy link
Member Author

aschwaighofer commented Jun 8, 2018

@swift-ci Please test

@aschwaighofer aschwaighofer merged commit 53500e6 into apple:master Jun 8, 2018

4 checks passed

Swift Test Linux Platform 11131 tests run, 0 skipped, 0 failed.
Details
Swift Test Linux Platform (smoke test)
Details
Swift Test OS X Platform 55840 tests run, 0 skipped, 0 failed.
Details
Swift Test OS X Platform (smoke test)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.