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

[4.2] SILGen: Fix no escape verification if the closure throws an exc… #17071

Merged
merged 1 commit into from Jun 11, 2018

Conversation

Projects
None yet
1 participant
@aschwaighofer
Member

aschwaighofer commented Jun 8, 2018

…eption

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

[4.2] SILGen: Fix no escape verification if the closure throws an exc…
…eption

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.

Member

aschwaighofer commented Jun 8, 2018

@swift-ci Please test

@aschwaighofer aschwaighofer merged commit e2bc6f9 into apple:swift-4.2-branch Jun 11, 2018

4 checks passed

Swift Test Linux Platform 11088 tests run, 0 skipped, 0 failed.
Details
Swift Test Linux Platform (smoke test)
Details
Swift Test OS X Platform 55625 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