wwstage: classify tagged call-source by stamped result type, not callee leaf name (#211)

rhstaggedabicall keyed the tagged-vs-scalar call-source decision off the
callee result type looked up by leaf NAME (fnretlookupmod), with the
receiver variable used as the "module". A value-receiver fn-ptr field
call s.f(...) whose leaf collides with a same-named global fn then
mis-bound the global's register shape, so the source was misclassified
as scalar and widened wrong: silent cs/ww asm divergence and wrong
runtime. Read the checker-stamped N_CALL result type (src.type_)
instead, mirroring the N_DOT sister branch. cstage already reads u->ret
off the typed callee (cmd/wcc/check.c:1490) and harec selects by
interned type id, not name (ref/harec/src/types.c:714).

Graduates test/wcc/782 to STAGE_WW + byte_id.
This commit is contained in:
2026-05-31 23:34:16 +09:00
parent 1995d8e43a
commit db9edb7c39
5 changed files with 143 additions and 122 deletions

View File

@@ -730,10 +730,12 @@ $(BIN)/test_fmt_handle_run: test/wcc/777_fmt_handle_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 782 — cstage-only pin for #211 (cgen sibling of #208). Self-contained
# single-file probe (no lib imports); cstage driver only, so no ww_ww dep.
# 782 — #211 close (cgen sibling of #208). Self-contained single-file
# probe (no lib imports). Graduated STAGE_CS | STAGE_WW + byte-id on
# #211 close: build + run on both stages + cs.s == ww.s (rule-10).
$(BIN)/test_fieldfn_leaf_collide_run: test/wcc/782_fieldfn_leaf_collide_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 $@ $<