Skip to content

[Macros] Fix a use-after-free with getSemanticAttrs(). #63076

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 2 commits into from
Jan 18, 2023

Conversation

hborla
Copy link
Member

@hborla hborla commented Jan 18, 2023

Having a request for semantic declaration attributes while still allowing the original linked list to be mutated directly can cause use-after-frees on pointers to old decl attributes. For now, introduce a request that expands member attribute macros with a side effect of adding the new attributes to the list. We can revisit this once attribute mutation via getAttrs() is audited across the frontend.

This change also re-applies the commit reverted in #63062

Resolves: rdar://104297642

Having a request for semantic declaration attributes while still allowing
the original linked list to be mutated directly can cause use-after-frees
on pointers to old decl attributes. For now, introduce a request that
expands member attribute macros with a side effect of adding the new
attributes to the list. We can revisit this once attribute mutation via
getAttrs() is audited across the frontend.
@hborla
Copy link
Member Author

hborla commented Jan 18, 2023

@swift-ci please test

@hborla hborla merged commit c88a420 into swiftlang:main Jan 18, 2023
@hborla hborla deleted the macro-use-after-free branch January 18, 2023 14:50
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.

1 participant