wcc/ww: def-dim array .len field-reads resolve the dimension from the type table

buf.len on a [MAX]u8 returned 0 — the cgdot len arms (local/global/
def) and letemitsize only read an N_INTLIT dimension. Route a
non-literal dimension through tichase().alen (the #21 fix mirrored
into the field-read consumers; .ptr arms are dim-independent).
Review-era task #56.
This commit is contained in:
2026-06-13 01:52:42 +09:00
parent faf1a2908b
commit b97be7301f
6 changed files with 308 additions and 30 deletions

View File

@@ -257,6 +257,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_defdim_slice_run \
$(BIN)/test_trystr_run \
$(BIN)/test_allocalias_run \
$(BIN)/test_defdim_field_run \
$(BIN)/test_gunsigned_run \
$(BIN)/test_taggedidx_run \
$(BIN)/test_fnptrcollide_run \
@@ -757,6 +758,17 @@ $(BIN)/test_allocalias_run: test/wcc/989_allocalias_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_defdim_field_run (#56): `.len` field-read on a `def`-dimensioned array
# (`[MAX]T`) resolves the length from the type table in the local/global/def
# cgdot arms + letemitsize (cgdot sibling of #21). Builds+runs on BOTH driver
# twins (rule-10).
$(BIN)/test_defdim_field_run: test/wcc/989_defdim_field_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.