wcc/ww: exprtypeoftry prefers the current module's symbol

The try-operand resolution used bare lookups (ident + bare-leaf call);
a cross-module same-leaf collision mistyped the operand. Prefer the
current module. The historic 995 byte-id break attributed to this swap
was contamination from the guard-bug-carrying bundle — re-probed clean
in isolation and at the full stack. The N_DOT module-keyed leaf stays
task #51. Report item [11], lookup half.
This commit is contained in:
2026-06-13 03:04:52 +09:00
parent 51e3b8f134
commit 1f2bc7fc26
5 changed files with 237 additions and 36 deletions

View File

@@ -261,6 +261,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_defdim_argslice_run \
$(BIN)/test_slttypepref_run \
$(BIN)/test_ampfncollide_run \
$(BIN)/test_trycallcollide_run \
$(BIN)/test_gunsigned_run \
$(BIN)/test_taggedidx_run \
$(BIN)/test_fnptrcollide_run \
@@ -804,6 +805,17 @@ $(BIN)/test_ampfncollide_run: test/wcc/989_ampfncollide_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_trycallcollide_run (#11a, c3): exprtypeoftry prefers the current
# module's symbol when typing a `?`/`!` operand whose bare leaf collides with
# a same-leaf decl in a later module. Builds+runs on BOTH driver twins
# (rule-10). See the test header.
$(BIN)/test_trycallcollide_run: test/wcc/989_trycallcollide_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 $@ $<
# 989_gunsigned_run (F7-c5, #25): a module-global unsigned ident on the
# divide/shift/relational path must pick the unsigned opcode. Builds+runs on
# BOTH driver twins (rule-10). CLASS-M — see the test header.