Chromium Code Reviews

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

Issue 2446593002: [wasm] Fix memory leak in wasm-module-runner.cc (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« 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 7629233ed94bb3eedc0f510e0c185c25c2a71c7f..55ccffd977cdd8ecae33d27708c21653fcba886b 100644
--- a/test/common/wasm/wasm-module-runner.cc
+++ b/test/common/wasm/wasm-module-runner.cc
@@ -81,14 +81,14 @@ const Handle<JSObject> InstantiateModuleForTesting(Isolate* isolate,
const Handle<JSObject> CompileInstantiateWasmModuleForTesting(
Isolate* isolate, ErrorThrower* thrower, const byte* module_start,
const byte* module_end, ModuleOrigin origin) {
- const WasmModule* module = DecodeWasmModuleForTesting(
- isolate, thrower, module_start, module_end, origin);
+ std::unique_ptr<const WasmModule> module(DecodeWasmModuleForTesting(
titzer 2016/10/24 13:34:40 This isn't quite right. This C++ object should be
ahaas 2016/10/24 14:04:29 This is not the WasmModule that is given to the in
+ isolate, thrower, module_start, module_end, origin));
if (module == nullptr) {
thrower->CompileError("Wasm module decoding failed");
return Handle<JSObject>::null();
}
- return InstantiateModuleForTesting(isolate, thrower, module);
+ return InstantiateModuleForTesting(isolate, thrower, module.get());
}
int32_t RunWasmModuleForTesting(Isolate* isolate, Handle<JSObject> instance,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine