Skip to content

Commit 9cfd721

Browse files
mkustermanncommit-bot@chromium.org
authored andcommitted
[VM] Handle kVoidCid/kDynamicCid/kVectorCid the same way
Issue #31798 Change-Id: Ifb08ec17b29a5e8d1f2a9b8b53a32cb810a8a3da Reviewed-on: https://dart-review.googlesource.com/44520 Reviewed-by: Vyacheslav Egorov <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
1 parent 65b2b1a commit 9cfd721

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

runtime/vm/object.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17543,16 +17543,19 @@ RawAbstractType* Type::Canonicalize(TrailPtr trail) const {
1754317543
Zone* zone = thread->zone();
1754417544
Isolate* isolate = thread->isolate();
1754517545

17546-
// Since void is a keyword, we never have to canonicalize the void type after
17547-
// it is canonicalized once by the vm isolate. The parser does the mapping.
17548-
ASSERT((type_class_id() != kVoidCid) || (isolate == Dart::vm_isolate()));
17546+
if ((type_class_id() == kVoidCid) && (isolate != Dart::vm_isolate())) {
17547+
ASSERT(Object::void_type().IsCanonical());
17548+
return Object::void_type().raw();
17549+
}
1754917550

17550-
// Since dynamic is not a keyword, the parser builds a type that requires
17551-
// canonicalization.
1755217551
if ((type_class_id() == kDynamicCid) && (isolate != Dart::vm_isolate())) {
1755317552
ASSERT(Object::dynamic_type().IsCanonical());
1755417553
return Object::dynamic_type().raw();
1755517554
}
17555+
if ((type_class_id() == kVectorCid) && (isolate != Dart::vm_isolate())) {
17556+
ASSERT(Object::vector_type().IsCanonical());
17557+
return Object::vector_type().raw();
17558+
}
1755617559

1755717560
const Class& cls = Class::Handle(zone, type_class());
1755817561

0 commit comments

Comments
 (0)