Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Unified Diff: src/wasm/wasm-module.cc

Issue 2096673002: [wasm] CompileAndRunWasmModule: return when decoding fails. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698