Skip to content

Commit 3da80be

Browse files
alexmarkovCommit Queue
authored and
Commit Queue
committed
[vm] Fix crashes on record types in mirrors and observatory
TEST=ci, manually verified tests with https://dart-review.googlesource.com/c/sdk/+/290760. Fixes #51900 Change-Id: I338bc1b1f2e58d2343f6195ff9d12151edbd90dc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291969 Reviewed-by: Ryan Macnak <[email protected]> Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent 134007a commit 3da80be

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

runtime/lib/mirrors.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,12 @@ static InstancePtr CreateTypeMirror(const AbstractType& type) {
530530
if (type.IsFunctionType()) {
531531
return CreateFunctionTypeMirror(type);
532532
}
533+
if (type.IsRecordType()) {
534+
const Class& cls =
535+
Class::Handle(IsolateGroup::Current()->object_store()->record_class());
536+
return CreateClassMirror(cls, AbstractType::Handle(cls.DeclarationType()),
537+
Bool::False(), Object::null_instance());
538+
}
533539
if (type.HasTypeClass()) {
534540
const Class& cls = Class::Handle(type.type_class());
535541
// Handle void and dynamic types.

runtime/observatory/lib/src/service/object.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,9 +2782,9 @@ M.InstanceKind stringToInstanceKind(String s) {
27822782
return M.InstanceKind.typeRef;
27832783
case 'ReceivePort':
27842784
return M.InstanceKind.receivePort;
2785-
case '_RecordType':
2785+
case 'RecordType':
27862786
return M.InstanceKind.recordType;
2787-
case '_Record':
2787+
case 'Record':
27882788
return M.InstanceKind.record;
27892789
case 'Finalizer':
27902790
return M.InstanceKind.finalizer;

0 commit comments

Comments
 (0)