diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/fuzz_shell.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/fuzz_shell.js b/scripts/fuzz_shell.js index d55007b18..0f413c2e6 100644 --- a/scripts/fuzz_shell.js +++ b/scripts/fuzz_shell.js @@ -175,7 +175,15 @@ var imports = { imports = Asyncify.instrumentImports(imports); // Create the wasm. -var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), imports); +var module = new WebAssembly.Module(binary); + +var instance; +try { + instance = new WebAssembly.Instance(module, imports); +} catch (e) { + console.log('exception: failed to instantiate module'); + quit(); +} // Handle the exports. var exports = instance.exports; @@ -216,4 +224,3 @@ sortedExports.forEach(function(e) { // Finish up Asyncify.finish(); - |