wcc/ww: def-dim array slice-arg default-hi takes the length from the type table

Passing buf[1:] of a [MAX]u8 as a call arg dropped the default-hi
length (the arg-push N_SLICE arms' fallback covered only named-alias
bases). Same type-table resolve at pushargsrev local+global. This
closes the def-dim dimension family by construction: every N_INTLIT-
keyed dim consumer (cgslice, cgdot, letemitsize, arg-push) now
carries the tichase().alen fallback — grep-proven, no consumer
remains. Fourth member surfaced by the family grep.
This commit is contained in:
2026-06-13 01:56:01 +09:00
parent b97be7301f
commit ffe37deaee
5 changed files with 252 additions and 18 deletions

View File

@@ -258,6 +258,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_trystr_run \
$(BIN)/test_allocalias_run \
$(BIN)/test_defdim_field_run \
$(BIN)/test_defdim_argslice_run \
$(BIN)/test_gunsigned_run \
$(BIN)/test_taggedidx_run \
$(BIN)/test_fnptrcollide_run \
@@ -769,6 +770,17 @@ $(BIN)/test_defdim_field_run: test/wcc/989_defdim_field_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_defdim_argslice_run (#56 c4): passing a slice of a `def`-dimensioned
# array as a call arg resolves the default-hi length from the type table in
# the N_SLICE arg-push arms (cgenutil pushargsrev local+global). Builds+runs
# on BOTH driver twins (rule-10).
$(BIN)/test_defdim_argslice_run: test/wcc/989_defdim_argslice_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.