Commit 0ab9ecc2 authored by ahaas's avatar ahaas Committed by Commit bot

[wasm] Fix a memory leak in test-run-wasm-module.

The memory leak is fixed by calling the GC at the end of the tests. The GC collects the WasmModuleWrapper objects, which deallocates WasmModule c++ object. For the mjsunit tests the GC is already called because of the --invoke_weak_callbacks flag.

BUG=chromium:662388

Review-Url: https://codereview.chromium.org/2476643003
Cr-Commit-Position: refs/heads/master@{#40822}
parent 34aec495
...@@ -2065,12 +2065,12 @@ bool wasm::ValidateModuleBytes(Isolate* isolate, const byte* start, ...@@ -2065,12 +2065,12 @@ bool wasm::ValidateModuleBytes(Isolate* isolate, const byte* start,
const byte* end, ErrorThrower* thrower, const byte* end, ErrorThrower* thrower,
ModuleOrigin origin) { ModuleOrigin origin) {
ModuleResult result = DecodeWasmModule(isolate, start, end, false, origin); ModuleResult result = DecodeWasmModule(isolate, start, end, false, origin);
if (result.ok()) { if (result.val) {
DCHECK_NOT_NULL(result.val);
delete result.val; delete result.val;
return true; } else {
DCHECK(!result.ok());
} }
return false; return result.ok();
} }
MaybeHandle<JSArrayBuffer> wasm::GetInstanceMemory(Isolate* isolate, MaybeHandle<JSArrayBuffer> wasm::GetInstanceMemory(Isolate* isolate,
......
This diff is collapsed.
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