Commit e31d34cb authored by mtrofin's avatar mtrofin Committed by Commit bot

[wasm] CompileAndRunWasmModule: return when decoding fails.

BUG=

Review-Url: https://codereview.chromium.org/2096673002
Cr-Commit-Position: refs/heads/master@{#37231}
parent 3a5b4ae9
......@@ -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.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment