Skip to content

Fix crash with invalid private @inlinable function #31060

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

slavapestov
Copy link
Contributor

We had some duplicated logic between getResilienceExpansion() and getFragileFunctionKind(). Clean this up by moving the latter into AST, and re-implementing the former in terms of the latter.

This also fixes a crash in at least one case where these two implementations had previously diverged.

Fixes rdar://problem/60605117.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov requested a review from CodaFi April 16, 2020 04:49
ResilienceExpansion DeclContext::getResilienceExpansion() const {
auto fragileKind = getFragileFunctionKind();
switch (fragileKind.kind) {
case FragileFunctionKind::Transparent:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: LLVM-style switch-cases please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that was an accident.

…ntext

We had some duplicated logic between getResilienceExpansion() and
getFragileFunctionKind(). Clean this up by moving the latter into
AST, and re-implementing the former in terms of the latter.

This also fixes a crash in at least one case where these two
implementations had previously diverged.

Fixes <rdar://problem/60605117>.
@slavapestov slavapestov force-pushed the fix-fragile-function-kind-crash branch from a19b6df to e2349bd Compare April 16, 2020 18:09
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov
Copy link
Contributor Author

15:29:21 The following tests FAILED:
15:29:21 	917 - TestFoundation.TestNotificationQueue-test_notificationQueueLifecycle (Failed)

@millenomi Any ideas?

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov slavapestov merged commit f62620f into swiftlang:master Apr 16, 2020
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