Index: src/snapshot/code-serializer.cc |
diff --git a/src/snapshot/code-serializer.cc b/src/snapshot/code-serializer.cc |
index 511f1117521b257fe4ec02c378d13d1e62c478ec..a51d7a90fc67ccefd89a75816d62d03f7f370525 100644 |
--- a/src/snapshot/code-serializer.cc |
+++ b/src/snapshot/code-serializer.cc |
@@ -231,7 +231,7 @@ std::unique_ptr<ScriptData> WasmCompiledModuleSerializer::SerializeWasmModule( |
WasmCompiledModuleSerializer wasm_cs(isolate, 0); |
wasm_cs.reference_map()->AddAttachedReference(*isolate->native_context()); |
wasm_cs.reference_map()->AddAttachedReference( |
- *compiled_module->module_bytes()); |
+ compiled_module->module_bytes()); |
ScriptData* data = wasm_cs.Serialize(compiled_module); |
return std::unique_ptr<ScriptData>(data); |
} |
@@ -268,10 +268,12 @@ MaybeHandle<FixedArray> WasmCompiledModuleSerializer::DeserializeWasmModule( |
MaybeHandle<HeapObject> obj = deserializer.DeserializeObject(isolate); |
if (obj.is_null() || !obj.ToHandleChecked()->IsFixedArray()) return nothing; |
- Handle<WasmCompiledModule> compiled_module = |
- Handle<WasmCompiledModule>::cast(obj.ToHandleChecked()); |
+ // Cast without type checks, as the module wrapper is not there yet. |
+ Handle<WasmCompiledModule> compiled_module( |
+ static_cast<WasmCompiledModule*>(*obj.ToHandleChecked()), isolate); |
WasmCompiledModule::RecreateModuleWrapper(isolate, compiled_module); |
+ DCHECK(WasmCompiledModule::IsWasmCompiledModule(*compiled_module)); |
return compiled_module; |
} |