Commit 7242a10
committed
fix(ssa): apply @reference heap-layout rule for Type::Unresolved too
`convert_type` already wraps `@reference` user types in
`Ptr(Struct(...))` when the typed AST hands us `Type::Named(id)`,
but the parallel `Type::Unresolved(name)` arm — which fires for
type references inside `impl` method bodies (`Vec3R { ... }`
inside `impl Add<Vec3R> for Vec3R`) — returned a bare
`Struct(...)`, missing the `is_reference` check. The constructor
lowering then took the value-type path (chained `InsertValue`
producing a struct SSA value rather than a malloc + per-field
store + pointer return) and downstream field-access GEPs took a
struct value as their `ptr` operand, panicking at
`into_pointer_value()` (llvm_backend.rs:1363).
The fix mirrors the `is_reference` check from the `Named` arm
into the `Unresolved` arm.
Bench impact: `bench_op_overload_ref` (1M iter × 2 calls = 2M
heap-Vec3R `+` ops) now runs cleanly through the LLVM tier — was
falling back to Cranelift silently because the BG-thread compile
panicked. ~30 ms exec, returning `Int(21000000)`.
CI gate: `bench_op_overload_ref` is now in the value-asserted
KERNELS list so any future regression that re-introduces this
shape gets caught loudly instead of falling back to Cranelift in
the background.1 parent 2cbfd84 commit 7242a10
3 files changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7542 | 7542 | | |
7543 | 7543 | | |
7544 | 7544 | | |
| 7545 | + | |
| 7546 | + | |
| 7547 | + | |
| 7548 | + | |
| 7549 | + | |
| 7550 | + | |
| 7551 | + | |
| 7552 | + | |
| 7553 | + | |
| 7554 | + | |
| 7555 | + | |
| 7556 | + | |
| 7557 | + | |
| 7558 | + | |
| 7559 | + | |
| 7560 | + | |
| 7561 | + | |
| 7562 | + | |
| 7563 | + | |
7545 | 7564 | | |
7546 | 7565 | | |
7547 | 7566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
| |||
0 commit comments