wcc_ww/cgen: #88 defisaddressable array leg chases the stamped def type
The `&D` addressability gate (defisaddressable, cgen.ww) keyed its array leg on the UNCHASED syntactic dtnode (N_TARRAY) — a def whose declared type is an ALIAS of an array missed the gate and fell to the rule-7 loud error, but the gate was lying: the ww def-array DATA emitter (emitdefconstants' array arm) already peels TY_NAMED off d.lhs.type_ transitively, so the alias def HAS a DATA symbol (probe-OBSERVED: `DATA main.D(SB)` emitted byte-id by both stages for the &-less program). Gate-only fix — tichase(dtn.type_) == TY_ARRAY — restores gate == emission set exactly; no emitter twin, no half-state. The struct leg (defvarstructinfo) already chased; plain [N]T defs agree under tnode and chased reads, so existing rows are byte-id-neutral by construction. cstage gates TK_AMP on the def_isarraydef registry fed by the g-fold-G1 chased let_isarray (cgen.c:3975-3977, 1446) and runs every row 0 — align ww UP. Pin: 944_alias_def_addr_run, 6 rows (plain + struct-def controls hold 0/0; 1/2-level alias + fwd-ref decl order graduate ww-LOUD -> 0/0 byte-id; str-def &S error-path STAYS LOUD both stages with a byte-identical diagnostic — the rule-7 tail text is compared w6c vs w6c_ww, so a silent reject or a divergent message both fail the row). def_l2's readback casts to the base array ptr: the natural (*p)[2] spelling over a 2-LEVEL-alias pointee trips a SEPARATE pre-existing CSTAGE double-deref (spurious MOVQ (AX),AX, SEGV; def-independent, ww correct) — filed as task #93 (#85 type_unwrap kin, F2b OUT), not fixed here (site-set form). Light gates: test-unit 290 green; sizelint 0; 989 ratchet zero flips; five-mains NEUTRAL vs master-74195ac scratch on identical inputs + cs==ww on all five. combined.ww regens ride along (#110).
This commit is contained in:
7
Makefile
7
Makefile
@@ -306,6 +306,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
|
||||
$(BIN)/test_alias_accept_run \
|
||||
$(BIN)/test_alias_idx_family_run \
|
||||
$(BIN)/test_alias_amp_idx_run \
|
||||
$(BIN)/test_alias_def_addr_run \
|
||||
$(BIN)/test_alias_global_decl_run \
|
||||
$(BIN)/test_tuple_nary_destructure_run \
|
||||
$(BIN)/test_rvalue_tuple_destructure_run \
|
||||
@@ -1475,6 +1476,12 @@ $(BIN)/test_alias_amp_idx_run: test/wcc/944_alias_amp_idx_run.c \
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BIN)/test_alias_def_addr_run: test/wcc/944_alias_def_addr_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 $@ $<
|
||||
|
||||
$(BIN)/test_alias_global_decl_run: test/wcc/944_alias_global_decl_run.c \
|
||||
$(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
|
||||
$(BIN)/ww_ww $(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
|
||||
|
||||
Reference in New Issue
Block a user