Skip to content

[6.0][ASTGen/Macros] Ensure 'offset' from plugin response is valid #72771

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

rintaro
Copy link
Member

@rintaro rintaro commented Apr 2, 2024

Cherry-pick #72714 into release/6.0

  • Explanation: We see some crashes presumably caused by invalid offset returned from macro plugins. Although we haven't been able to find a reproducer, guard not to generate invalid source location by checking offfset is within the buffer length.
  • Scope: Macro expansion
  • Risk: Low, just adding a guard
  • Testing: Passes current test cases. No additional test cases because we haven't found a reproducer
  • Issues: rdar://125625879
  • Reviewer: Ben Barham (@bnbarham)

We see some crashes presumably caused by invalid 'offset' returned from
macro plugins. Although we haven't been able to find a reproducer, guard
not to generate invalid source location by checking 'offfset' is within
the buffer length.

rdar://125625879
(cherry picked from commit 9d336a0)
@rintaro rintaro requested a review from a team as a code owner April 2, 2024 17:24
@rintaro
Copy link
Member Author

rintaro commented Apr 2, 2024

@swift-ci Please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Thank you!

@rintaro rintaro enabled auto-merge April 2, 2024 20:57
@rintaro rintaro merged commit dbb788a into swiftlang:release/6.0 Apr 2, 2024
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