From adf52c44016ba75da31991ab250dbdba54f4f758 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 21 Jul 2026 19:12:38 +0000 Subject: [PATCH] Restructure an errant goto which only accidentally never broke anything. Add some debug output to mkwasmbuilds.c. FossilOrigin-Name: 0ca4e748e1682046f2e060876bcf7e8d249aa5611d939d32dc1365d3bcf12b48 --- ext/wasm/libcmpp.c | 77 ++++++++++++++++++++--------------------- ext/wasm/mkwasmbuilds.c | 5 +-- manifest | 15 ++++---- manifest.uuid | 2 +- 4 files changed, 48 insertions(+), 51 deletions(-) diff --git a/ext/wasm/libcmpp.c b/ext/wasm/libcmpp.c index 543e544c1e..57dac633ce 100644 --- a/ext/wasm/libcmpp.c +++ b/ext/wasm/libcmpp.c @@ -10364,10 +10364,11 @@ int cmpp__b_base64_encode(cmpp *pp, cmpp_b const * bIn, cmpp_b * bOut){ cmpp_size_t const nvMax = 1000 * 1000 * 1000 /* 1B == default SQLITE_MAX_LENGTH, but that symbol is not exposed in its public API. We "could" extract that limit from pp's db - here, but... nah. We're only using it as a guideline, it's not - part of the db state so we're not beholden to its limits. In - this context the limit is arbitrary, anyway - we inherit it - from this code's origins and retain it for simplicity. */; + here, but... no. We're only using it as a guideline: bOut is + not not part of the db state so we're not beholden to the db's + limits. In this context the limit is arbitrary, anyway - we + inherit it from this code's origins and retain it for + simplicity. */; if( ppCode ) return ppCode; nc = 4*((nv+2)/3); /* quads needed */ nc += (nc+(B64_DARK_MAX-1))/B64_DARK_MAX + 1; /* LFs and a 0-terminator */ @@ -13636,43 +13637,39 @@ int cmpp__d_delayed_load(cmpp *pp, char const *zName){ cmpp_dx_f_dangling_closer, 0); cmpp_d * dQ = 0; rc = cmpp_d_register(pp, &rQ, &dQ); - if( 0==rc ){ - /* - It would be preferable to delay registration of query:no-rows - until we need it, but doing so causes an error when: - - |#if 0 - |#query - |... - |#query:no-rows HERE - |... - |#/query - |#/if - - Because query:no-rows won't have been registered, and unknown - directives are an error even in skip mode. Maybe they - shouldn't be. Maybe we should just skip them in skip mode. - That's only been an issue since doing delayed registration of - directives, so it's not come up until recently (as of - 2025-10-27). i was so hoping to be able to get _rid_ of skip - mode at some point. - */ - cmpp_d * dNoRows = 0; - cmpp_d_reg const rNR = { - .name = "query:no-rows", - .opener = { - .f = cmpp_dx_f_dangling_closer, - .flags = F_NC - } - }; - rc = cmpp_d_register(pp, &rNR, &dNoRows); - if( 0==rc ){ - dNoRows->closer = dQ->closer; - assert( !dQ->impl.state ); - dQ->impl.state = dNoRows; + if( rc ) goto end; + /* + It would be preferable to delay registration of query:no-rows + until we need it, but doing so causes an error when: + + |#if 0 + |#query + |... + |#query:no-rows HERE + |... + |#/query + |#/if + + Because query:no-rows won't have been registered, and unknown + directives are an error even in skip mode. Maybe they shouldn't + be. Maybe we should just skip them in skip mode. That's only + been an issue since doing delayed registration of directives, so + it's not come up until recently (as of 2025-10-27). i was so + hoping to be able to get _rid_ of skip mode at some point. + */ + cmpp_d * dNoRows = 0; + cmpp_d_reg const rNR = { + .name = "query:no-rows", + .opener = { + .f = cmpp_dx_f_dangling_closer, + .flags = F_NC } - } - goto end; + }; + rc = cmpp_d_register(pp, &rNR, &dNoRows); + if( rc ) goto end; + dNoRows->closer = dQ->closer; + assert( !dQ->impl.state ); + dQ->impl.state = dNoRows; } #endif /*CMPP_OMIT_D_DB*/ diff --git a/ext/wasm/mkwasmbuilds.c b/ext/wasm/mkwasmbuilds.c index e1ea8412e4..d89aaf8529 100644 --- a/ext/wasm/mkwasmbuilds.c +++ b/ext/wasm/mkwasmbuilds.c @@ -774,8 +774,9 @@ static void mk_lib_mode(const char *zBuildName, const BuildDef * pB){ pf("%s# Begin build [%s%s]. flags=0x%02x\n", zBanner, pB->zEmo, zBuildName, pB->flags); - pf("# zCmppD=%s\n# zBaseName=%s\n", - pB->zCmppD ? pB->zCmppD : "", zBaseName); + pf("# zCmppD=%s\n# zBaseName=%s\n# zDotWasm=%s\n", + pB->zCmppD ? pB->zCmppD : "", + zBaseName, zDotWasm); pf("b.names += %s\n" "emo.b.%s = %s\n", zBuildName, zBuildName, pB->zEmo); diff --git a/manifest b/manifest index 5a388cf171..b17b5bf6ec 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\sbase64.wasm=1\sflag\sto\sext/wasm/GNUmakefile\stells\sit\sto\sembed\seach\sresulting\sWASM\sfile\sdirectly\sin\sits\scounterpart\sJS\sfile\sbase64-encoded.\sThis\sis\sroughly\s20%\slarger\sand\ssaves\sa\snetwork\srequest\sbut\sis\soverall\sless\sefficient\sso\swill\snot\sbe\sthe\snew\sdefault.\sIt\smay\sbe\sinteresting\sfor\scustom\sbuilds,\sin\sparticular\sfor\sserver-side\snode.js. -D 2026-07-21T16:58:02.731 +C Restructure\san\serrant\sgoto\swhich\sonly\saccidentally\snever\sbroke\sanything.\sAdd\ssome\sdebug\soutput\sto\smkwasmbuilds.c. +D 2026-07-21T19:12:38.601 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -636,9 +636,9 @@ F ext/wasm/index-dist.html db23748044e286773f2768eec287669501703b5d5f72755e8db73 F ext/wasm/index.html 5bf6cf1b0a3c8b9f5f54d77f2219d7ae87a15162055ce308109c49b1dcab4239 F ext/wasm/jaccwabyt/jaccwabyt.js 4e2b797dc170851c9c530c3567679f4aa509eec0fab73b466d945b00b356574b F ext/wasm/jaccwabyt/jaccwabyt.md 6aa90fa1a973d0ad10d077088bea163b241d8470c75eafdef87620a1de1dea41 -F ext/wasm/libcmpp.c d8f0ebc08f7f9ac7c6b222481fc545613668440b78fa726a95ac99b61893ecfa +F ext/wasm/libcmpp.c 58ca45c18bc68710fa8f37bd11aa49a0ea937b9d95580c40b5ad89174aa07976 F ext/wasm/mkdist.sh f8883b077a2ca47cf92e6f0ce305fbf72ca648c3501810125056c4b09c2d5554 x -F ext/wasm/mkwasmbuilds.c afaba6a5b79ff6adeb13cea26b62722828593e8cdbed55cf5563c61b2d94780c +F ext/wasm/mkwasmbuilds.c 3c5ccccd974403fc8317a3b2a2c905aad929187244703b07cf2736111dee65e2 F ext/wasm/module-symbols.html e54f42112e0aac2a31f850ab33e7f2630a2ea4f63496f484a12469a2501e07e2 F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96 F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63 @@ -2217,9 +2217,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P 06f3bbc5bddc2e763042f8b487a3deedf47c54b7fa785ba6fd6abd524b4cbe3a 696988aac30797139060eb2718fcfda0363f1fa73df1187ea56956681d577411 -R 9b101ed22e16de099d1646505ada9788 -T +closed 696988aac30797139060eb2718fcfda0363f1fa73df1187ea56956681d577411 +P 7a06190b712e0634dfc9ac53ab7632c2f46186cd280afd2da4af35df433bc3ed +R bc464bf49e508da49f58a8c6427d14f3 U stephan -Z 496a43a929d483f8d4de5af1e3c36fa7 +Z c9ad94aef282f3d56a8d2e88706fbe9f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index de1c691ecc..2af2f1b610 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7a06190b712e0634dfc9ac53ab7632c2f46186cd280afd2da4af35df433bc3ed +0ca4e748e1682046f2e060876bcf7e8d249aa5611d939d32dc1365d3bcf12b48 -- 2.47.3