heap-allocated tuple scrutinee interacts with building a cons whose tail is a recursive call #41
Owner
```
This is now well-characterized. The port has surfaced a real compiler backend bug — not a flaw in the branch's stdlib code. Minimal deterministic repro:
fn zw(xs: List[i64], ys: List[i64]): List[i64] =
match (xs, ys) with
| ([x | xt], [y | yt]) -> [Num.add(x, y) | zw(xt, yt)] -- SIGSEGV
| (_, _) -> []
end
The trigger is the conjunction of three things — remove any one and it works:
- recursion + a tuple scrutinee (match (xs, ys)) + consing the recursive call as a list tail ([h | zw(...)]).
Evidence:
- dot (same tuple-scrutinee recursion, but returns i64 via Num.add(_, dot(...))) → works (140).
- zw rewritten with nested separate scrutinees (match xs … match ys …, still building a list) → works ([11, 22, 33]).
- non-recursive tuple match, map/foldl with closures → all work.
```
- closed this issue
-
added the buglabel
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?