]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: fix ICE in TyVar constructor
authorlishin <lishin1008@gmail.com>
Sat, 27 Sep 2025 01:10:42 +0000 (02:10 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 20:30:56 +0000 (21:30 +0100)
commit238cb68de8d8f77b0e0b34f939c152515afaa5ca
treeea21c191cc02c48a572e938c93003ecf82b5043d
parent36fd20078c3ac9d5852577ceb96c1aee934d87e0
gccrs: fix ICE in TyVar constructor

gcc/rust/ChangeLog:

* typecheck/rust-tyty-util.cc (TyVar::TyVar): Add null check to avoid ICE.
(TyVar::get_tyty): Return nullptr when lookup fails.
(TyVar::clone): Handle null base type safely.
(TyVar::monomorphized_clone): Add fallback for error types.

gcc/testsuite/ChangeLog:

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

Signed-off-by: lishin <lishin1008@gmail.com>
gcc/rust/typecheck/rust-tyty-util.cc
gcc/testsuite/rust/compile/issue-3556.rs [new file with mode: 0644]