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

Unified Diff: test/common/wasm/wasm-module-runner.cc

Issue 2365493003: [wasm] Correctly handle the result of WasmModule::Instantiate in the wasm-module-runner (Closed)
Patch Set: Created 4 years, 3 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: test/common/wasm/wasm-module-runner.cc
diff --git a/test/common/wasm/wasm-module-runner.cc b/test/common/wasm/wasm-module-runner.cc
index 4a18f1c42458fb010befbb227584357e8a04b50e..7bbacc77c12e7ef99433fccb4122bcae3b44f47f 100644
--- a/test/common/wasm/wasm-module-runner.cc
+++ b/test/common/wasm/wasm-module-runner.cc
@@ -66,10 +66,14 @@ const Handle<JSObject> InstantiateModuleForTesting(Isolate* isolate,
isolate, module->module_start, module->module_end, thrower,
ModuleOrigin::kWasmOrigin);
if (module_object.is_null()) return Handle<JSObject>::null();
- return WasmModule::Instantiate(isolate, module_object.ToHandleChecked(),
- Handle<JSReceiver>::null(),
- Handle<JSArrayBuffer>::null())
- .ToHandleChecked();
+ MaybeHandle<JSObject> maybe_instance = WasmModule::Instantiate(
+ isolate, module_object.ToHandleChecked(), Handle<JSReceiver>::null(),
+ Handle<JSArrayBuffer>::null());
+ Handle<JSObject> instance;
+ if (!maybe_instance.ToHandle(&instance)) {
+ return Handle<JSObject>::null();
+ }
+ return instance;
}
int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
« 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