w6c+w6c_ww: loud-stop non-ident/non-local append spread source (#34 review)

A spread whose source was not a local ident fell PAST the spread arm:
cstage continued into the single-value stores with the N_SPREAD node
(garbage store), wwstage silently SKIPPED the value entirely — a silent,
cs!=ww-divergent miscompile (append(ys, f()...): cs exit 0 / ww exit 144,
want 3), reachable for every element kind and predating #34 for scalars.
Both stages now rule-7 loud-stop the shape (deferred, task #37).

Also pins the widener's already-tagged single-value source path
(tagged_ident_src row, i64 + bool members) and adds the
spread_call_loudstop BUILD_FAIL row — test 800 is now 15 rows / 43
fixtures.
This commit is contained in:
2026-06-04 02:27:06 +09:00
parent 70fa9e2264
commit 36be9f469d
5 changed files with 104 additions and 9 deletions

View File

@@ -6357,6 +6357,20 @@ cgexpr(Cg *c, Node *n, Local *locals)
fatal("#34: append() element kind "
"unsupported (rule-7)");
for (Node *vn = sn->next; vn; vn = vn->next) {
/* #34 review: a spread whose source is not a
* local ident used to fall PAST the spread arm
* into the single-value stores with the
* N_SPREAD node (cstage garbage store; wwstage
* silently SKIPPED it — divergent). Deferred
* source shape, task #37. */
if (vn->kind == N_SPREAD) {
if (!vn->lhs || vn->lhs->kind != N_IDENT)
fatal("#34: append() spread source "
"shape unsupported (rule-7)");
if (localfind(locals, vn->lhs->str) == 0)
fatal("#34: append() spread source "
"ident is not a local (rule-7)");
}
if (vn->kind == N_SPREAD &&
vn->lhs && vn->lhs->kind == N_IDENT) {
int it_off = localfind(locals, vn->lhs->str);