Skip to content

Commit 2ad715e

Browse files
aamcommit-bot@chromium.org
authored andcommitted
[vm/hr] Directly compare type arguments count when validate hot reload.
There might be better fix with using canonical types for comparison, we just need to make sure we canonicalize class's type when finalizing it. Bug:#32942 Change-Id: I2301a7cb91146d587893f91f2d6ee7b731ea3c62 Reviewed-on: https://dart-review.googlesource.com/54314 Commit-Queue: Alexander Aprelev <[email protected]> Reviewed-by: Régis Crelier <[email protected]>
1 parent 8dbe716 commit 2ad715e

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

runtime/tests/vm/vm.status

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ cc/Dart2JSCompilerStats: Fail, Crash # Issue 27369
99
cc/Fail0: Fail # These tests are expected to crash on all platforms.
1010
cc/Fail1: Fail # These tests are expected to crash on all platforms.
1111
cc/Fail2: Fail # These tests are expected to crash on all platforms.
12-
cc/IsolateReload_ChangeInstanceFormat9: Fail, Crash # issue 32942
1312
cc/IsolateReload_PendingConstructorCall_AbstractToConcrete: Fail, Crash # Issue 32981. Fails on non-Windows, crashes on Windows (because of test.py special handline)
1413
cc/IsolateReload_PendingConstructorCall_ConcreteToAbstract: Fail, Crash # Issue 32981. Fails on non-Windows, crashes on Windows (because of test.py special handline)
1514
cc/IsolateReload_PendingStaticCall_DefinedToNSM: Fail # Issue 32981

runtime/vm/object_reload.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -634,13 +634,9 @@ bool Class::RequiresInstanceMorphing(const Class& replacement) const {
634634

635635
bool Class::CanReloadFinalized(const Class& replacement,
636636
IsolateReloadContext* context) const {
637-
// Make sure the declaration types matches for the two classes.
637+
// Make sure the declaration types argument count matches for the two classes.
638638
// ex. class A<int,B> {} cannot be replace with class A<B> {}.
639-
640-
const AbstractType& dt = AbstractType::Handle(DeclarationType());
641-
const AbstractType& replacement_dt =
642-
AbstractType::Handle(replacement.DeclarationType());
643-
if (!dt.Equals(replacement_dt)) {
639+
if (NumTypeArguments() != replacement.NumTypeArguments()) {
644640
context->AddReasonForCancelling(new (context->zone()) TypeParametersChanged(
645641
context->zone(), *this, replacement));
646642
return false;

0 commit comments

Comments
 (0)