wcc/ww: nodefnptr keys the bare-ident arm on the stamped type

nodefnptr matched bare idents by NAME against the fn table, so a
global var colliding with a fn leaf classified as a fn pointer —
wwstage silently built what cstage rejects at link (review finding
#14). Key on the stamped type; the #124 &mod.fn arm is preserved.
989_fnptrcollide_run pins both stages reject (red 1/2 pre-fix:
wwstage built rc=7).
This commit is contained in:
2026-06-12 00:21:16 +09:00
parent 47b971330b
commit d6052e0829
5 changed files with 184 additions and 6 deletions

View File

@@ -253,6 +253,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_tupfieldsize_run \
$(BIN)/test_gunsigned_run \
$(BIN)/test_taggedidx_run \
$(BIN)/test_fnptrcollide_run \
$(BIN)/test_arr_ptr_global \
$(BIN)/test_def_arr_infer_len \
$(BIN)/test_def_arr_len \
@@ -689,6 +690,16 @@ $(BIN)/test_taggedidx_run: test/wcc/989_taggedidx_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_fnptrcollide_run (F7-c7, #14): a value ident whose leaf collides with
# a fn name must not be mis-folded into the fn's TEXT reloc. Build-must-fail
# on BOTH driver twins (rule-10); wwstage gated. See the test header.
$(BIN)/test_fnptrcollide_run: test/wcc/989_fnptrcollide_run.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 $@ $<
$(BIN)/test_let_global: test/wcc/630_let_global.c $(BIN)/ww $(BIN)/w6c \
$(BIN)/w6a $(BIN)/w6l $(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<