Skip to content

Commit 5a8df27

Browse files
ggreifclaude
andcommitted
nix(pkgs): patch wabt with WebAssembly/wabt#2744
`return_call_indirect` under `table64` rejects an i64 table-index in upstream wabt, while the matching `call_indirect` accepts it — a clean asymmetry in the validator. The patched wabt mirrors the working `OnCallIndirect` plumbing in `OnReturnCallIndirect` (4 lines + a regression test). With the patch, our `tailcall` bench's `return_call_indirect` sites validate clean and the temporary `tailcall.valid.{ok,ret.ok}` files this PR introduced are no longer needed — drop them. Patch is fetched from the open upstream PR via `fetchpatch`. Drop this overlay (and the two-line `__intentionallyOverridingVersion` shim) once the fix lands and nixpkgs picks it up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a35fec7 commit 5a8df27

3 files changed

Lines changed: 19 additions & 34 deletions

File tree

nix/pkgs.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,24 @@
5959

6060
# ic-wasm
6161
(self: super: { ic-wasm = import ./ic-wasm.nix self; })
62+
63+
# wabt with WebAssembly/wabt#2744 patched in (return_call_indirect
64+
# + table64 validator fix). Patches nixpkgs's wabt source rather
65+
# than swapping it out so the third_party/* submodules nixpkgs
66+
# already fetches stay intact. Drop this overlay once #2744 lands
67+
# and propagates to nixpkgs.
68+
(self: super: {
69+
wabt = super.wabt.overrideAttrs (old: {
70+
patches = (old.patches or []) ++ [
71+
(super.fetchpatch {
72+
name = "wabt-pr-2744-return_call_indirect-table64.patch";
73+
url = "https://github.com/WebAssembly/wabt/pull/2744.patch";
74+
hash = "sha256-RzGaVgitOcv2KkHV1HT77A2WLPwJtBxYB9rS0u42tko=";
75+
})
76+
];
77+
version = "${old.version}-pre-2744";
78+
__intentionallyOverridingVersion = true;
79+
});
80+
})
6281
];
6382
}

test/bench/ok/tailcall.valid.ok

Lines changed: 0 additions & 33 deletions
This file was deleted.

test/bench/ok/tailcall.valid.ret.ok

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)