Index: src/wasm/wasm-module.cc |
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc |
index 00d38ecfa960180e91d44cc5f2f042a6153180c2..81369673949cfd421318288f494ce164c0a6b9c9 100644 |
--- a/src/wasm/wasm-module.cc |
+++ b/src/wasm/wasm-module.cc |
@@ -1039,12 +1039,14 @@ int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, |
ModuleResult decoding_result = |
DecodeWasmModule(isolate, &zone, module_start, module_end, false, |
asm_js ? kAsmJsOrigin : kWasmOrigin); |
+ |
+ std::unique_ptr<const WasmModule> module(decoding_result.val); |
if (decoding_result.failed()) { |
// Module verification failed. throw. |
thrower.Error("WASM.compileRun() failed: %s", |
decoding_result.error_msg.get()); |
+ return -1; |
} |
- std::unique_ptr<const WasmModule> module(decoding_result.val); |
if (module->import_table.size() > 0) { |
thrower.Error("Not supported: module has imports."); |