| Index: src/wasm/wasm-objects.cc
|
| diff --git a/src/wasm/wasm-objects.cc b/src/wasm/wasm-objects.cc
|
| index 1d1092cc623983649e56dffffe627c4fd0507e0c..6b142162db06955f89e0d0792467f6defb8396b7 100644
|
| --- a/src/wasm/wasm-objects.cc
|
| +++ b/src/wasm/wasm-objects.cc
|
| @@ -531,7 +531,13 @@ WasmSharedModuleData* WasmSharedModuleData::cast(Object* object) {
|
| }
|
|
|
| wasm::WasmModule* WasmSharedModuleData::module() {
|
| - return reinterpret_cast<WasmModuleWrapper*>(get(kModuleWrapper))->get();
|
| + // We populate the kModuleWrapper field with a Foreign holding the
|
| + // address to the address of a WasmModule. This is because we can
|
| + // handle both cases when the WasmModule's lifetime is managed through
|
| + // a Managed<WasmModule> object, as well as cases when it's managed
|
| + // by the embedder. CcTests fall into the latter case.
|
| + return *(reinterpret_cast<wasm::WasmModule**>(
|
| + Foreign::cast(get(kModuleWrapper))->foreign_address()));
|
| }
|
|
|
| DEFINE_OPTIONAL_ARR_ACCESSORS(WasmSharedModuleData, module_bytes, kModuleBytes,
|
|
|