Replace kwlookup's 30-arm streqn if-ladder with two parallel module-level tables — kwnames: [30]str + kwkinds: [30]tkind — scanned linearly via strings.compare, and delete the hand-rolled streqn. Rides #18 (module- level [N]str static-init + relocations) for the kwnames data and #8 ([N]enum element sizing) for the kwkinds[i] read, which is itself the construct that surfaced the #8 elemsizeofc/array-init-store miscompile. Two parallel arrays rather than a [N]kwent array-of-struct: a str inside an aggregate element is the filed #18 follow-up. Mirrors the C twin cmd/wcc/tok.c kwlookup (N=30, linear, no hash). Source re-applied on top of the #8 cgen fix and regenerated fresh: the wwstage-compiled toktest now runs correctly (exit 0, no segfault) where pre-#8 it smashed the frame on the local [N]tkind init store.
1.2 MiB
1.2 MiB