Skip to content

Conversation

@lucasly-ba
Copy link

@lucasly-ba lucasly-ba commented Oct 15, 2025

An imbricated exported macro leads to a segfault.

Fixes #3617

gcc/rust/ChangeLog:

* metadata/rust-export-metadata.cc (ExportContext::emit_macro): Change method argument NodeId to AST::MacroRulesDefinition.
* metadata/rust-export-metadata.h: Likewise.
* util/rust-hir-map.cc (Mappings::insert_exported_macro): Insert AST::MacroRulesDefinition instead of NodeId.
* util/rust-hir-map.h: Change methods declarations of exported macros.

gcc/testsuite/ChangeLog:

* rust/compile/issue-3617.rs: New test.

Signed-off-by: Lucas Ly Ba [email protected]

Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

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

Great job - just fix my nitpick and we can merge this. LGTM!

An imbricated exported macro leads to a segfault.

gcc/rust/ChangeLog:

	* metadata/rust-export-metadata.cc (ExportContext::emit_macro):
	Change method argument NodeId to AST::MacroRulesDefinition.
	* metadata/rust-export-metadata.h:
	Likewise.
	* util/rust-hir-map.cc (Mappings::insert_exported_macro):
	Insert AST::MacroRulesDefinition instead of NodeId.
	* util/rust-hir-map.h:
	Change methods declarations of exported macros.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-3617.rs: New test.

Signed-off-by: Lucas Ly Ba <[email protected]>
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.

ICE: segfault TokenCollector

2 participants