Skip to content

Commit 0582c51

Browse files
cjihrigdanielleadams
authored andcommitted
test: fix wasi/test-return-on-exit on 32-bit systems
Starting with the V8 8.8 update, this test has been regularly crashing with an out of memory error on 32-bit Windows. The issue has been narrowed down to a function not being bound. This seems like a V8 bug, but at least it seems that we can work around it. Fixes: #37374 PR-URL: #37615 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 23d6541 commit 0582c51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/wasi/test-return-on-exit.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const buffer = fs.readFileSync(modulePath);
2121
// Verify that if a WASI application throws an exception, Node rethrows it
2222
// properly.
2323
const wasi = new WASI({ returnOnExit: true });
24-
wasi.wasiImport.proc_exit = () => { throw new Error('test error'); };
24+
const patchedExit = () => { throw new Error('test error'); };
25+
wasi.wasiImport.proc_exit = patchedExit.bind(wasi.wasiImport);
2526
const importObject = { wasi_snapshot_preview1: wasi.wasiImport };
2627
const { instance } = await WebAssembly.instantiate(buffer, importObject);
2728

0 commit comments

Comments
 (0)