wcc_ww/check: inferred struct-lit let plants the synthesized TNAME — field(SB) name-leak + tagged-field assign bound (#24)
For an annotation-less `let p = pt{...}` checkletassign planted exprtype's
N_STRUCTLIT result — the struct decl's BODY node (N_TSTRUCT, per #66) — as
the let's type. Every cgen local-arm dispatch (cgdot read, cgassign
tagged-field store, the alias peel) is N_TNAME-keyed, so the body matched
no arm: field reads fell to the module-qualified fallback and emitted the
FIELD NAME as a global symbol (MOVQ f(SB) — link-fail, #211 name-leak
family; silent corruption if a same-named global exists), and a tagged-
field assign fell to the assign-resolver TY_TAGGED loud bound. Both PG5
wwstage symptoms, one root; plain structs leaked too. Normalizing the
inferred binding to the synthesized TNAME (mktname + tinfofornode stamp)
routes every consumer down the already-byte-id annotated path. cstage
needs no twin: check.c:1477 clet carries Sym.type (tinfo) and its
emission is annotation-invariant (probed). Test 811: 10 rows x 2 drivers
+ 10 asm-byte-id; pre-fix wwstage link-fails every unannotated row
(incl. the `...` autofill and parenthesized forms; nested s.f.g ran
but cs!=ww asm).
This commit is contained in:
14
Makefile
14
Makefile
@@ -398,6 +398,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
|
||||
$(BIN)/test_insert_elem \
|
||||
$(BIN)/test_arrlit_overlong \
|
||||
$(BIN)/test_idx_structlit_store \
|
||||
$(BIN)/test_inferred_let_struct \
|
||||
$(BIN)/test_placeaddr_store \
|
||||
$(BIN)/test_tryprop_multisuccess \
|
||||
$(BIN)/test_append_place \
|
||||
@@ -1086,6 +1087,19 @@ $(BIN)/test_idx_structlit_store: test/wcc/809_idx_structlit_store.c \
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
# #24 (fold-5 prereq, PG5 wwstage pair): field read/assign through an
|
||||
# annotation-less struct-literal binding `let p = pt{...}` — pre-fix
|
||||
# the wwstage checker planted the struct BODY node (N_TSTRUCT) as the
|
||||
# inferred let's type, no N_TNAME-keyed cgen arm matched, and `p.f`
|
||||
# leaked the FIELD NAME as a global symbol (`MOVQ f(SB)`, link-fail;
|
||||
# #211 name-leak family) while a tagged-field assign hit the
|
||||
# assign-resolver loud bound. Runtime rows + asm byte-id per row.
|
||||
$(BIN)/test_inferred_let_struct: test/wcc/811_inferred_let_struct.c \
|
||||
$(BIN)/ww $(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
|
||||
$(BIN)/ww_ww \
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
# F8+F9 (tasks #5/#12, regex fold-2b): `?` interim single-success gate
|
||||
# (|success| > 1 loud-rejected on BOTH stages until task #14's
|
||||
# subset-union typing) + direct `f()? is T` / `match (f()?)` reject
|
||||
|
||||
Reference in New Issue
Block a user