From 9504f104068eac73e324f6402d341893d8fbc6fd Mon Sep 17 00:00:00 2001 From: dzaima Date: Thu, 26 Sep 2024 03:24:47 +0300 Subject: [PATCH] fix test/precompiled.bqn --- build/cc.bqn | 6 +++--- src/load.c | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/build/cc.bqn b/build/cc.bqn index d57014a6..1505cfc4 100755 --- a/build/cc.bqn +++ b/build/cc.bqn @@ -69,11 +69,11 @@ FmtComp ← { iarrs ← intarrCache.Done@ ⋄ Li↩! - ! ⟨⟩ ≡ ⊑iarrs.compvals + hasEmpty ← ⟨⟩ ≡ ⊑iarrs.compvals init ← ⟨⟩ a { - 1‿i: n ← i⊑iarrs.comp ⋄ (0=n) ⊑ ⟨∾⟨"iarrs[",F n,"]"⟩, "iarrs0"⟩; # special-case first array (i.e. empty array) as there isn't enough aliasing info for the compiler to deduplicate loads + 1‿i: n ← i⊑iarrs.comp ⋄ (hasEmpty∧0=n) ⊑ ⟨∾⟨"iarrs[",F n,"]"⟩, "iarrs0"⟩; # special-case first array (i.e. empty array) as there isn't enough aliasing info for the compiler to deduplicate loads 2=•Type⊑𝕩? 𝕩; 0‿n: ONum2C n; ⟨0‿a, 0‿b, ⟨c, d⟩⟩: cs≡⌊cs←a‿b? ∧´cs≥0? ∧´cs<4? ∾⟨"m_blockinfo(", F a+b×4, ", ", 𝕊 c, ", ", 𝕊 d, ")"⟩; @@ -94,7 +94,7 @@ FmtComp ← { "};", lf "static const u32 iarrs_lens[] = {", ','Join F∘≠¨ iarrs.compvals, "};", lf "init_intarrs(iarrs, iarrs_data, iarrs_lens, ", F iarrs.n, ");", lf - "B iarrs0 = iarrs[0];", lf + hasEmpty / "B iarrs0 = iarrs[0];", lf ∾{0𝕊𝕩: ""; ∾⟨"incByG(iarrs[", F 𝕩, "], ", F 𝕨, ");", lf⟩}¨⟜↕⟜≠ iarrs.counts-1 ∾init "load_importBlock", srcmap/"_src", "(", CStr name, ",", lf diff --git a/src/load.c b/src/load.c index b54c0ff0..1fae0f8c 100644 --- a/src/load.c +++ b/src/load.c @@ -570,10 +570,9 @@ void load_init() { // very last init function #ifdef PRECOMP decG(load_compOpts); - Block* c = compileAll( + Block* c = ({ #include "../build/interp" - , bi_N, bi_N, bi_N, bi_N, NULL, 0 - ); + }); B interp = evalFunBlockConsume(c); printI(interp); printf("\n");