Skip to content

Conversation

P-E-P
Copy link
Member

@P-E-P P-E-P commented Aug 12, 2025

Fixes #3974

No check was performed and the value was assumed non null.
Path conversion returned an empty path for "Self" due to a hack in
generics Self injection that prevented any "Self!" macro from beeing
recognized correctly.

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_stmt_or_expr): Add null check
	on parse_macro_invocation_partial call.
	* ast/rust-path.cc (Path::convert_to_simple_path): Do not exclude
	capitalized "Self".

gcc/testsuite/ChangeLog:

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

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
@P-E-P P-E-P added this pull request to the merge queue Aug 14, 2025
Merged via the queue into Rust-GCC:master with commit a67aafd Aug 14, 2025
13 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.

segfault in parsing / parse_stmt_or_expr
1 participant