Skip to content

[ASTGen] Protect parseASTFromSyntaxTree for SWIFT_BUILD_SWIFT_SYNTAX #69858

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
merged 1 commit into from
Nov 14, 2023

Conversation

drodriguez
Copy link
Contributor

The field IsForASTGen only exists when SWIFT_BUILD_SWIFT_SYNTAX is defined, but the usage was unprotected. The whole function can be inside the protected block because it only seems to be invoked from inside blocks already protected by SWIFT_BUILD_SWIFT_SYNTAX.

Fix for #69761

@drodriguez
Copy link
Contributor Author

@swift-ci please test

@rintaro
Copy link
Member

rintaro commented Nov 14, 2023

Ah, thank you!

@rintaro
Copy link
Member

rintaro commented Nov 14, 2023

Reading https://github.com/apple/swift/pull/69761/files#r1392952571 I decided to un-guard the field in Parser.h. Feel free to do so in this PR, or you can merge this first and I will do it later.

@drodriguez
Copy link
Contributor Author

I would prefer you to do that change, if you don't mind. I think I understand the intention of the variable and which one should be its value, but you probably know better.

There's an extra error (missing semicolon in one of the #else branches). I can fix that here.

The field `IsForASTGen` only exists when `SWIFT_BUILD_SWIFT_SYNTAX` is
defined, but the usage was unprotected. The whole function can be inside
the protected block because it only seems to be invoked from inside
blocks already protected by `SWIFT_BUILD_SWIFT_SYNTAX`.

Fix for swiftlang#69761
@drodriguez
Copy link
Contributor Author

@swift-ci please test

@drodriguez drodriguez enabled auto-merge (squash) November 14, 2023 18:14
@drodriguez drodriguez merged commit 094e9ab into swiftlang:main Nov 14, 2023
@drodriguez drodriguez deleted the ifdef-parse-bridging branch November 14, 2023 23:27
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