Skip to content

Fix crash in merge-modules involving a file with extension of nested type #35809

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

akyrtzi
Copy link
Contributor

@akyrtzi akyrtzi commented Feb 6, 2021

rdar://74062542

@akyrtzi akyrtzi requested a review from CodaFi February 6, 2021 20:02
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Feb 6, 2021

@swift-ci smoke test

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Feb 8, 2021

@swift-ci Please test Windows platform

static TypeDecl *
findNestedTypeDeclInModule(ModuleDecl *extensionModule,
Identifier name, NominalTypeDecl *parent) {
return findNestedTypeDeclInModule(nullptr, extensionModule, name, parent);
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes me nervous since we can now set up a cross-ref that causes resolution to re-enter itself - especially through a name lookup. This was the cause of a ton of circular lookup problems in the SDK when we were refactoring the clang importer. Lazy member loading no longer has re-entrancy guards in it to catch this too...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't a circular issue be detected in the frontend invocations before reaching merge-modules?
But regardless, it looks to me that this particular code-path follows the strict xref path components, so it's going to reach the end of the lookup by definition.

@CodaFi
Copy link
Contributor

CodaFi commented Feb 9, 2021

Thanks!

@CodaFi CodaFi merged commit ef32bd1 into swiftlang:main Feb 9, 2021
@akyrtzi akyrtzi deleted the 74062542-crash-extension-nested-type branch February 9, 2021 01:02
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