diff --git a/pkg/native_compiler/lib/snapshot/snapshot.dart b/pkg/native_compiler/lib/snapshot/snapshot.dart index 16c4db06f5b..4b531443e97 100644 --- a/pkg/native_compiler/lib/snapshot/snapshot.dart +++ b/pkg/native_compiler/lib/snapshot/snapshot.dart @@ -165,6 +165,7 @@ class SnapshotSerializer { addBaseObject(const ast.NullType()); addBaseObject(const ast.NeverType.nonNullable()); addBaseObject(ast.ListConstant(const ast.DynamicType(), const [])); + addBaseObject(UndefinedConstant()); // TODO: generate these stubs instead of referencing them from the VM. addBaseObject(StubCode.Subtype1TestCache); addBaseObject(StubCode.Subtype2TestCache); diff --git a/runtime/vm/module_snapshot.cc b/runtime/vm/module_snapshot.cc index c3920617657..fead63041a3 100644 --- a/runtime/vm/module_snapshot.cc +++ b/runtime/vm/module_snapshot.cc @@ -1642,6 +1642,7 @@ void Deserializer::Deserialize() { AddBaseObject(Type::Handle(zone(), object_store->null_type())); AddBaseObject(Type::Handle(zone(), object_store->never_type())); AddBaseObject(Object::empty_array()); + AddBaseObject(Object::optimized_out()); AddBaseObject(StubCode::Subtype1TestCache()); AddBaseObject(StubCode::Subtype2TestCache()); AddBaseObject(StubCode::Subtype3TestCache());