wcc/cgen: #148 slice-global by-value call-arg — name(SB) base for global slice ident, not (BP) garbage (cstage)

The slice-IDENT call-arg fast path pushed the header words off off(BP)
where off=localfind(name); for a module-global slice localfind→0, so it
read saved-BP/RIP/caller garbage instead of name(SB). Add the global
branch (LEAQ name(SB) base, push 16/8/0 off it) mirroring the sibling
N_SLICE arm; local path unchanged. cstage-only: wwstage checker-rejects
the shape (#120), so byte-id-safe and the twin defers to #125. Unblocks
path c2-stack (dot/dotdot are faithful module-global []u8). Sibling
structarg fast-path filed #150.
This commit is contained in:
2026-06-08 10:24:48 +09:00
parent 6e1d958d9b
commit 26d6e2abad
3 changed files with 190 additions and 0 deletions

View File

@@ -467,6 +467,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_dotbase_arr_run \
$(BIN)/test_dotbase_addr_slice_run \
$(BIN)/test_slicecopy_assign_run \
$(BIN)/test_globalslice_arg_run \
$(BIN)/test_structlit_arrfield_run \
$(BIN)/test_defdim_struct_run \
$(BIN)/test_arraytoslice_run \
@@ -2135,6 +2136,11 @@ $(BIN)/test_slicecopy_assign_run: test/wcc/952_slicecopy_assign_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_globalslice_arg_run: test/wcc/953_globalslice_arg_run.c \
$(BIN)/ww $(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_structlit_arrfield_run: test/wcc/949_structlit_arrfield_run.c \
$(BIN)/ww $(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
$(LIB)/libwwrt.a | $(BIN)