Skip to content

Fix #61531: swift-symbolgraph-extract crashes when trying to emit the 'Swift' module #62825

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

theMomax
Copy link
Contributor

@theMomax theMomax commented Jan 4, 2023

This PR fixes a crash in symbol graph generation caused by an empty SmallVector access while expanding protocol compositions when expanding conformances for a symbol. It also expands the relevant test so that it actually covers the logic causing the crash.

The bug affected all targets that declare a protocol conformance in an extension, where the protocol is or inherits from a protocol composition, for example:

protocol A {}
protocol B {}

typealias AB = A & B

struct S {}
extension S: AB {}

Resolves #61531

…emit the 'Swift' module

fix a crash in symbol graph generation caused by an empty SmallVector access while expanding protocol compositions during conformance expansion for extension block symbols
@QuietMisdreavus QuietMisdreavus self-requested a review January 4, 2023 16:02
Copy link
Contributor

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks!

@QuietMisdreavus
Copy link
Contributor

@swift-ci Please smoke test

@QuietMisdreavus
Copy link
Contributor

@swift-ci Please build toolchain macOS

@QuietMisdreavus
Copy link
Contributor

@swift-ci Please Build Toolchain macOS Platform

3 similar comments
@QuietMisdreavus
Copy link
Contributor

@swift-ci Please Build Toolchain macOS Platform

@QuietMisdreavus
Copy link
Contributor

@swift-ci Please Build Toolchain macOS Platform

@QuietMisdreavus
Copy link
Contributor

@swift-ci Please Build Toolchain macOS Platform

@QuietMisdreavus
Copy link
Contributor

Sorry for the noise, i was trying to get a toolchain built to test some other projects that were starting to get similar build failures in SymbolGraphGen. I was just able to confirm that a locally-built compiler resolved those issues as well, so i'm going to tag a radar (rdar://103322385) as i merge. Thanks so much!

@QuietMisdreavus QuietMisdreavus merged commit 8c6fe1c into swiftlang:main Jan 6, 2023
@tayloraswift
Copy link
Member

FINALLY

thank u Max!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants