From 14b33993c29e87e5137b80a555eaf647c734c3cc Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Thu, 11 Jun 2026 02:37:40 +0900 Subject: [PATCH] lib/fnmatch: explicit '\\': u8 cast; fnmatch graduates to the byte-id gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wwstage over-rejects harec's flexible-rune-const narrow (rune lit promotes into any int whose range fits — harec check.c:1910, types.c promote_flexible); explicit cast until that promotion lands in ww (#29, revert to bare '\\' then). With the enum-as fix fnmatch is byte-identical across stages: 989 #59.14 graduates M_WWREJECT -> M_ID, transferring 972's cstage 8/8 behavior to the provably-identical wwstage binary — the dark-regression gate. (#29) --- lib/fnmatch/fnmatch.ww | 3 ++- test/wcc/989_lib_byteid.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/fnmatch/fnmatch.ww b/lib/fnmatch/fnmatch.ww index f5fd9a33..b18235ed 100644 --- a/lib/fnmatch/fnmatch.ww +++ b/lib/fnmatch/fnmatch.ww @@ -123,7 +123,8 @@ fn pat_next(pat: str, pos: *i32, fl: flag) (u8 | star | question | bracket | end *pos += 1; return c2; }; - return '\\'; + // #29: wwstage over-rejects the implicit flexible-rune-const narrow (harec promote_flexible accepts); explicit cast until flexible-const promotion lands — revert to bare '\\' then. + return '\\': u8; }; return c; }; diff --git a/test/wcc/989_lib_byteid.c b/test/wcc/989_lib_byteid.c index 3d4d85fa..1b08296a 100644 --- a/test/wcc/989_lib_byteid.c +++ b/test/wcc/989_lib_byteid.c @@ -154,8 +154,12 @@ static const struct ent ents[] = { /* -------- wwstage front-end gaps (task #59) -------------- */ { .fixture = "lib/crypto/sha256/sha256_test.ww", .mode = M_WWREJECT, .cite = "#59.13" }, + /* #59.14 graduated to M_ID by #27: the #27b enum-as-int cgen fix + * (value passthrough, not a tagged assertion) + the fnmatch.ww:126 + * `'\\': u8` explicit cast (the rune-lit→u8 narrow w6c_ww rejects at + * a checked position) make w6c_ww compile fnmatch byte-identically. */ { .fixture = "lib/fnmatch/fnmatchtest.ww", - .mode = M_WWREJECT, .cite = "#59.14" }, + .mode = M_ID, .cite = "#59.14 graduated by #27" }, /* #59.15 shlex graduated to M_ID by B-full Layer 1 (#14 nominal * typeeqast): the cross-module bare-vs-qualified variant forward * w6c_ww over-rejected now compiles byte-identically. */