Skip to content

Commit

Permalink
test: fix wasi/test-return-on-exit on 32-bit systems
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
cjihrig authored and targos committed May 1, 2021
1 parent b192227 commit df93cb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/wasi/test-return-on-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const buffer = fs.readFileSync(modulePath);
// Verify that if a WASI application throws an exception, Node rethrows it
// properly.
const wasi = new WASI({ returnOnExit: true });
wasi.wasiImport.proc_exit = () => { throw new Error('test error'); };
const patchedExit = () => { throw new Error('test error'); };
wasi.wasiImport.proc_exit = patchedExit.bind(wasi.wasiImport);
const importObject = { wasi_snapshot_preview1: wasi.wasiImport };
const { instance } = await WebAssembly.instantiate(buffer, importObject);

Expand Down

0 comments on commit df93cb4

Please sign in to comment.