wcc/cgen: #64+#68 tuple-literal cursor-fill decl-blind — massign + call-arg widen (both-stage)
A tuple LITERAL with a declared-tagged element reached the cursor-fill
helper (cg_tuple_lit_to_cursor) through the generic cgexpr(N_TUPLE) arm
with no declared type, so the element was stored stamped-keyed at its
constructed scalar width rather than widened into the declared tagged box.
Both consumers ran silent and wrong on both stages (#263 gate-blind:
cs==ww byte-identical, both wrong — runtime is the only net).
#64 massign: N_MASSIGN derives a declared tuple type from the lvalue
binding types and threads it into cg_tuple_lit_to_cursor + the receive
loop (mirror of the #57 N_LET wire); a `_` target falls back to the rhs
literal element type for cursor stride.
#68 call-arg: the send is made param-aware (fill over the PARAM tuple) and
the restage guard graduates a declared-tagged element to a real widen
(reusing cg_widen_tagged_store); nested tuple/struct/array elements and
tagged elements with no param decl stay rule-7 loud. The matching
pop/drain is made param-aware too so push count == pop count: a
param-aware send pushes the box's N words, so the drain must pop N or the
SysV arg sequence skews. This is a push/pop balance requirement of the
send change, not a separate latent under-drain (the standalone trailing-
arg drain is already correct at HEAD).
Closed by construction: the only remaining cg_tuple_lit_to_cursor caller
passing NULL/nil is the generic cgexpr(N_TUPLE) arm, provably non-widening
(constructed type == governing type). The four widening consumers — LET,
RETURN, MASSIGN, call-arg — are all decl-wired. Whole-tuple single-ident
reassign from a tuple literal is rule-7 loud (task #49), not a silent
widening consumer, so the residual NULL arm stays non-widening.
Pin: 945_tuple_lit_declblind_run — massign / call-arg / `_`-control /
call-arg-drain / nested-tuple-ERR rows, each base-fail at abd97e6 and
post-pass with cs==ww byte-id.
This commit is contained in:
13
Makefile
13
Makefile
@@ -321,6 +321,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
|
||||
$(BIN)/test_peellint_gate \
|
||||
$(BIN)/test_tuple_nary_destructure_run \
|
||||
$(BIN)/test_rvalue_tuple_destructure_run \
|
||||
$(BIN)/test_tuple_lit_declblind_run \
|
||||
$(BIN)/test_overcap_tuple_field_store_run \
|
||||
$(BIN)/test_mixed_scalar_tuple_sret_run \
|
||||
$(BIN)/test_tuple_in_union_run \
|
||||
@@ -1590,6 +1591,18 @@ $(BIN)/test_rvalue_tuple_destructure_run: test/wcc/945_rvalue_tuple_destructure_
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
# #64 + #68: tuple LITERAL fills the register cursor DECL-BLIND — the #57
|
||||
# decl wire (a declared-tagged element widens into its box) stopped at
|
||||
# N_LET/N_RETURN; destructure-REASSIGN (#64) and CALL-ARG send (#68) still
|
||||
# rode the decl-less route (box stored/sent word0-only, cursor skewed).
|
||||
# Both stages, #263 gate-blind (byte-id cs==ww, both ran wrong). Run +
|
||||
# cs==ww byte-id.
|
||||
$(BIN)/test_tuple_lit_declblind_run: test/wcc/945_tuple_lit_declblind_run.c \
|
||||
$(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
|
||||
$(BIN)/ww_ww $(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
# #234: over-cap tuple sret store into a local struct field / indexed local
|
||||
# (run + cs==ww byte-id), deferred forms loud-stop (builderr both drivers).
|
||||
$(BIN)/test_overcap_tuple_field_store_run: test/wcc/940_overcap_tuple_field_store_run.c \
|
||||
|
||||
Reference in New Issue
Block a user