File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -6908,6 +6908,8 @@ TypeArgumentsPtr TypeArguments::Canonicalize(Thread* thread,
6908
6908
if (result.IsNull()) {
6909
6909
// Canonicalize each type argument.
6910
6910
AbstractType& type_arg = AbstractType::Handle(zone);
6911
+ GrowableHandlePtrArray<const AbstractType> canonicalized_types(zone,
6912
+ num_types);
6911
6913
for (intptr_t i = 0; i < num_types; i++) {
6912
6914
type_arg = TypeAt(i);
6913
6915
type_arg = type_arg.Canonicalize(thread, trail);
@@ -6916,7 +6918,7 @@ TypeArgumentsPtr TypeArguments::Canonicalize(Thread* thread,
6916
6918
ASSERT(IsRecursive());
6917
6919
return this->ptr();
6918
6920
}
6919
- SetTypeAt(i, type_arg);
6921
+ canonicalized_types.Add( type_arg);
6920
6922
}
6921
6923
// Canonicalization of a type argument of a recursive type argument vector
6922
6924
// may change the hash of the vector, so invalidate.
@@ -6931,6 +6933,9 @@ TypeArgumentsPtr TypeArguments::Canonicalize(Thread* thread,
6931
6933
// canonical entry.
6932
6934
result ^= table.GetOrNull(CanonicalTypeArgumentsKey(*this));
6933
6935
if (result.IsNull()) {
6936
+ for (intptr_t i = 0; i < num_types; i++) {
6937
+ SetTypeAt(i, canonicalized_types.At(i));
6938
+ }
6934
6939
// Make sure we have an old space object and add it to the table.
6935
6940
if (this->IsNew()) {
6936
6941
result ^= Object::Clone(*this, Heap::kOld);
You can’t perform that action at this time.
0 commit comments