ww driver: enumeratedir grows past 256 entries

The wwstage driver silently dropped directory entries past a 256
cap; the cstage twin already grows by realloc-doubling. Grow the
same way (seed 8, double) so both stages agree on any directory size.
This commit is contained in:
2026-06-13 04:37:47 +09:00
parent f7845057a7
commit 4dc8459a90
4 changed files with 221 additions and 22 deletions

View File

@@ -262,6 +262,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_slttypepref_run \
$(BIN)/test_defercap_run \
$(BIN)/test_loopcap_run \
$(BIN)/test_enumcap_run \
$(BIN)/test_ampfncollide_run \
$(BIN)/test_trycallcollide_run \
$(BIN)/test_gunsigned_run \
@@ -817,6 +818,17 @@ $(BIN)/test_loopcap_run: test/wcc/989_loopcap_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_enumcap_run (#65, F13 c3): the driver's directory enumerator grows
# dynamically (mirror cstage realloc-doubling) instead of silently capping at
# 256 files. Builds on both driver twins and asserts a byte-identical
# combined.ww on a >256-file module (rule-10). See the test header.
$(BIN)/test_enumcap_run: test/wcc/989_enumcap_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_ampfncollide_run (#4, c2): `&fn` synthesis (unoptype TK_AMP +
# assignableaddrfn) prefers the current module's fn when a same-leaf fn is
# declared in a later module. Builds/rejects on BOTH driver twins (rule-10).