Commit c6ee9e4
committed
Until #225 PR2 the #199 closure ABI ([fnId@0,envPtr@4] via the
exported __indirect_function_table) had only ever been *statically*
compiled estate-wide — the blind spot the two PR2 defects hid in. The
async tests now exercise it but only THROUGH the CPS transform; the
existing tests/codegen/test_closure_*.affine have NO `.mjs` host
(compile-only). This adds the missing negative-control.
tests/codegen/closure_indirect_dispatch.{affine,mjs}: a captured
closure (`fn(u:Unit) => base + 35`, base = local 7) passed to a plain
`extern fn invokeCallback(cb: fn(Unit)->Int)->Int`; the host dispatches
it via __indirect_function_table (wrapHandler, identical to
packages/affine-vscode/mod.js). Verified the unit imports ONLY
`env.invokeCallback` (no thenableThen ⇒ async transform provably not
involved) yet still exports `__indirect_function_table`; asserts table
exported + closure fired once + captured local reached via envPtr
(7+35=42). Protects the shared #199 path for ALL closure users
independent of #205.
Gate: full tools/run_codegen_wasm_tests.sh green incl. the new test;
dune test --force 290/290. Zero regression.
#235 estate-consumer audit (recorded on the issue): the ONLY estate
consumer that genuinely warrants its own runtime smoke is
rsr-certifier (standards#123 — full #199 closures + #205 path, ships
its own wrapHandler clone, zero wasm tests). my-lang (#199-only),
idaptik/reposystem (.ts generic vscode, not this ABI), boj-server/
gitbot-fleet (no consumer) are defensibly static-only now this
upstream guarantee exists.
Refs #235 — deliverable (1) done; the rsr-certifier per-repo smoke
(standards repo) is the remaining tracked item, so not Closes.
1 parent 46bb174 commit c6ee9e4
2 files changed
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments