templates: {s} with one string hole and nothing else is a new string, not s itself - it was the one template that passed its string through (string() does), and code that wrote it as a copy kept what it then freed; the mark rides the callee, since escape analysis writes the call's uns; reseeded

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 20:14:58 +03:00
parent a436cfbe35
commit dd25267502
6 changed files with 29922 additions and 29729 deletions

View file

@ -293,8 +293,10 @@ function parse_interp(raw: pointer) -> Node {
}
}
if lj > 0 or (acc == null) { acc = interp_add(acc, interp_lit(lit, lj)) }
if acc.kind == E_CALL { acc.a.uns = TPL_COPY } # `{s}` alone is a new string, never s itself (emit_call.ludic)
return acc
}
const TPL_COPY: int = 91 # on the callee of a template's lone string(hole)
# emit E(field: v, ...) — shared by the statement form and the expression form.
# As an expression it yields a cancellable event's cancelled flag (0/1); a