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

Unified Diff: test/cctest/wasm/wasm-run-utils.h

Issue 2676513008: [wasm] Managed<T> ensures T's lifetime does not leak past Isolate's (Closed)
Patch Set: renamed to ManagedObjectFinalizer, and using "finalizer"` Created 3 years, 10 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 | « test/cctest/wasm/test-managed.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/wasm-run-utils.h
diff --git a/test/cctest/wasm/wasm-run-utils.h b/test/cctest/wasm/wasm-run-utils.h
index 31f98f4ce63bd7b7bce221257c5e73d385f32564..7a893df2fb5cd432914033e8871ec179211838ec 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -331,8 +331,10 @@ class TestingModule : public ModuleEnv {
Handle<WasmInstanceObject> InitInstanceObject() {
Handle<SeqOneByteString> empty_string = Handle<SeqOneByteString>::cast(
isolate_->factory()->NewStringFromOneByte({}).ToHandleChecked());
- Handle<Managed<wasm::WasmModule>> module_wrapper =
- Managed<wasm::WasmModule>::New(isolate_, &module_, false);
+ // The lifetime of the wasm module is tied to this object's, and we cannot
+ // rely on the mechanics of Managed<T>.
+ Handle<Foreign> module_wrapper =
+ isolate_->factory()->NewForeign(reinterpret_cast<Address>(&module));
Handle<Script> script =
isolate_->factory()->NewScript(isolate_->factory()->empty_string());
script->set_type(Script::TYPE_WASM);
« no previous file with comments | « test/cctest/wasm/test-managed.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698