lang: fix struct-field null/undef over-store (issue 0154)

Assigning null/--- to a struct field picked up a leaked enclosing
target_type (the function's return type, set for the whole body), so
constNull/constUndef built a whole-struct-typed value. The oversized
store overran the field's slot and clobbered the saved frame pointer,
so the function returned to 0x0. Surfaced building a by-value-returned
struct whose array field precedes a pointer field (Scheduler.init()).

Fix: add null_literal/undef_literal to the needs_target switch in
lowerAssignment so the field's own type is used. Regression:
examples/types/0193-types-sret-array-before-pointer.sx.
This commit is contained in:
agra
2026-06-21 18:43:33 +03:00
parent bdf83db4c8
commit b1e06f21e3
6 changed files with 95 additions and 1 deletions