Commit 0427d48
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>1 parent ab46a3b commit 0427d48
File tree
2 files changed
+16
-3
lines changed- gcc
- rust/typecheck
- testsuite/rust/compile
2 files changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
98 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments