| Index: runtime/vm/dart_api_impl.cc
|
| diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
|
| index 8ff22bf2b15fd41b3e2b047a16b3f205ad9ec596..e5cf6ae42b6d7fd580c2346b723f7ec4f1550c95 100644
|
| --- a/runtime/vm/dart_api_impl.cc
|
| +++ b/runtime/vm/dart_api_impl.cc
|
| @@ -2136,7 +2136,7 @@ DART_EXPORT Dart_Handle Dart_InstanceGetType(Dart_Handle instance) {
|
| RETURN_TYPE_ERROR(Z, instance, Instance);
|
| }
|
| const AbstractType& type =
|
| - AbstractType::Handle(Instance::Cast(obj).GetType());
|
| + AbstractType::Handle(Instance::Cast(obj).GetType(Heap::kNew));
|
| return Api::NewHandle(T, type.Canonicalize());
|
| }
|
|
|
| @@ -4074,7 +4074,8 @@ DART_EXPORT Dart_Handle Dart_InvokeConstructor(Dart_Handle object,
|
|
|
| // Construct name of the constructor to invoke.
|
| const String& constructor_name = Api::UnwrapStringHandle(Z, name);
|
| - const AbstractType& type_obj = AbstractType::Handle(Z, instance.GetType());
|
| + const AbstractType& type_obj =
|
| + AbstractType::Handle(Z, instance.GetType(Heap::kNew));
|
| const Class& cls = Class::Handle(Z, type_obj.type_class());
|
| const String& class_name = String::Handle(Z, cls.Name());
|
| const Array& strings = Array::Handle(Z, Array::New(3));
|
|
|