wcc: reject module-scope alloc/call let initializers at check time

A module-scope let whose rhs runs code (alloc, call — peeled through
cast/?/! wrappers) emitted no DATAW slot: emit_lets' fold-fail
silently skipped the definition and every reference died at LINK
time with 'undefined reference', the one unacceptable failure mode
(rule 7). Hare's model rejects at check time (ref/harec/src/
check.c:4360 'Unable to evaluate initializer at compile time') and
routes runtime init through @init, which ww does not have — so both
frontends now reject at the declaration with identical wording.

alias_infptr_global flips compile->error as the alloc pin (its
letvartnode N_TPTR-over-N_TSTRUCT coverage lives on in the local
alias_infptr_{nest,slicecap} siblings); callinit_global_reject pins
the call shape. Corpus pin 1741/345/21/209/1166/3482.
This commit is contained in:
2026-08-08 19:15:10 +09:00
parent 84206ff4ed
commit b52f30a894
5 changed files with 65 additions and 9 deletions

View File

@@ -1,13 +1,13 @@
package wwfixture;
def protocolversion: i32 = 1;
def corpuscount: i32 = 1740;
def errorcount: i32 = 343;
def compilecount: i32 = 22;
def corpuscount: i32 = 1741;
def errorcount: i32 = 345;
def compilecount: i32 = 21;
def runcount: i32 = 209;
def runexitcount: i32 = 1166;
def nativecount: i32 = 3480;
def corpushash: str = "a2f2514f07ca4e20457331e30f051394da3e59fcfa8f5f6ec3b33d9c14490354";
def nativecount: i32 = 3482;
def corpushash: str = "bad5b37d555f3f4d742f7a6fcfa857ff46315757233819a19eb9bc1da2800ce7";
type directive = enum i32 {
ERROR = 0,