wcc: nullable-global storage is a loud reject pending #15, both stages
A module-level nullable `(*T | void)` GLOBAL has no storage path in either stage: let_emit_size / letemitsize returned 0 for the nullable TY_TAGGED, so let_collect skipped registration and emit_lets skipped DATA. The three READ paths then miscompiled SILENTLY and identically- wrong (a #263-class both-wrong gap, not a wwstage align-up): match read 0(BP) = saved BP via the let_islet-gated #87 arm falling to localfind; `g is *T` / `g as *T` emitted MOVQ name(SB) for a symbol with no DATA → w6l undefined-reference. cstage's #87 match arm was itself `!is_nullable`- gated, so both stages were wrong. This is the silent→loud bridge: die loud at the size/storage layer the instant a nullable global is declared, so all three read paths hit one diagnostic instead of a silent miscompile. A silent gap here is exactly what "stable before CSP" forbids — CSP's process/handle/chan singletons (`let c: *Chan | void`) are THE canonical nullable-global consumer. The full storage + read-class arc (real DATA, nil/void/address-of init, let- registration, the three SB-resolution read arms) is deferred to task #15 (CSP-prereq); the `&`-init sub-problem additionally couples to the #48 static address-of relocation gap (which already bites a plain `*T` global init the same way). Diagnostic core text is identical both stages ("nullable-global storage unimplemented (task #15)"); cstage's fatal() adds the harness-wide "ww: " err.c prefix err.ww does not, the same per-stage asymmetry every existing both-stage reject carries. Byte-id-neutral: the corpus declares zero nullable globals (grep-verified), so the loud path is unreached in self- compile and the emitted asm is zero-move; the embedded w6c/wwdump combined.ww amalgamations are regenerated for the cgen.ww source change. New 989_nullableglobal_reject: 6 reject rows (match/is/as on a &gv init, plus nil-init and void-init match, plus an inline non-aliased nullable form) prove rc!=0 + the shared diagnostic on both stages, init- and form-invariant; 2 controls (non-nullable tagged global, plain nil-init *T global) prove the reject is keyed on the nullable TY_TAGGED and the #87 storage path is untouched.
This commit is contained in:
15
Makefile
15
Makefile
@@ -252,6 +252,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
|
||||
$(BIN)/test_catA_f2_reject \
|
||||
$(BIN)/test_intoverflow_reject \
|
||||
$(BIN)/test_unknowndecl_reject \
|
||||
$(BIN)/test_nullableglobal_reject \
|
||||
$(BIN)/test_idxarg_run \
|
||||
$(BIN)/test_chainidx_run \
|
||||
$(BIN)/test_tupfieldsize_run \
|
||||
@@ -721,6 +722,20 @@ $(BIN)/test_unknowndecl_reject: test/wcc/989_unknowndecl_reject.c \
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
# 989_nullableglobal_reject (#45 silent->loud bridge, task #15 prereq): a
|
||||
# module-level nullable `(*T | void)` GLOBAL has no storage path, so a
|
||||
# match/is/as on it silently miscompiled (0(BP) read / undefined ref) on
|
||||
# BOTH stages. The bridge dies LOUD at the size/storage layer; the full
|
||||
# storage + read-class arc is deferred to #15 (CSP handle-singleton
|
||||
# prereq). Needs the full cstage + wwstage tool sets plus libwwrt for the
|
||||
# control links.
|
||||
$(BIN)/test_nullableglobal_reject: test/wcc/989_nullableglobal_reject.c \
|
||||
$(BIN)/ww $(BIN)/ww_ww \
|
||||
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
|
||||
$(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
# 989_idxarg_run (F7-c2, #45/#46): an indexed slice/str element passed as
|
||||
# a call arg must push its full multi-word header. Builds+runs each fixture
|
||||
# on BOTH the cstage `ww` and wwstage `ww_ww` drivers (rule-10), so it needs
|
||||
|
||||
Reference in New Issue
Block a user