Skip to content

gccrs: fix ICE for empty enum variant - #4081

Merged
philberty merged 1 commit into
Rust-GCC:masterfrom
Lishin1215:3947
Aug 17, 2025
Merged

gccrs: fix ICE for empty enum variant#4081
philberty merged 1 commit into
Rust-GCC:masterfrom
Lishin1215:3947

Conversation

@Lishin1215

Copy link
Copy Markdown
Contributor

Fixes #3947
gcc/rust/ChangeLog:

* rust-gcc.cc (constructor_expression): 
Ensure vec_alloc reserves at least one element.

gcc/testsuite/ChangeLog:

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

Comment thread gcc/rust/rust-gcc.cc Outdated
@Lishin1215
Lishin1215 force-pushed the 3947 branch 2 times, most recently from 7e2064c to 34a1709 Compare August 15, 2025 10:34
Comment thread gcc/rust/rust-gcc.cc Outdated
gcc/rust/ChangeLog:

	* rust-gcc.cc (constructor_expression):
	Ensure vec_alloc reserves at least one element.

gcc/testsuite/ChangeLog:

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

Signed-off-by: lishin <lishin1008@gmail.com>

@philberty philberty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@philberty
philberty added this pull request to the merge queue Aug 17, 2025
Merged via the queue into Rust-GCC:master with commit 92706cc Aug 17, 2025
13 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in libcore 1.49 Aug 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ICE in Compile, at rust/backend/rust-compile-pattern.h:36 type switcheroo

3 participants