Skip to content

[Runtime] Fix printing keypaths with LocalDeclName subscript types. #74635

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

mikeash
Copy link
Contributor

@mikeash mikeash commented Jun 21, 2024

We assumed a bit too much about the structure of a single-argument subscript demangle tree and assumed that the argument identifier node was always in the same place. If it wasn't, we'd try to get text from the wrong node and get a bogus StringRef. Verify the node kind before trying to extract text, and handle LocalDeclName nodes as well as Identifier nodes.

rdar://129886558

@mikeash
Copy link
Contributor Author

mikeash commented Jun 24, 2024

@swift-ci please test

Copy link
Contributor

@al45tair al45tair left a comment

Choose a reason for hiding this comment

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

LGTM

We assumed a bit too much about the structure of a single-argument subscript demangle tree and assumed that the argument identifier node was always in the same place. If it wasn't, we'd try to get text from the wrong node and get a bogus StringRef. Verify the node kind before trying to extract text, and handle LocalDeclName nodes as well as Identifier nodes.

rdar://129886558
@mikeash mikeash force-pushed the anykeypath-printing-private-subscript-type branch from 70131a3 to 1a08891 Compare June 24, 2024 16:23
@mikeash
Copy link
Contributor Author

mikeash commented Jun 24, 2024

@swift-ci please test

@mikeash mikeash enabled auto-merge June 24, 2024 19:02
@tbkka
Copy link
Contributor

tbkka commented Jun 24, 2024

This looks worth cherry-picking to me.

@mikeash mikeash merged commit fbe7d89 into swiftlang:main Jun 24, 2024
4 of 5 checks passed
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.

3 participants