Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: runtime/vm/class_finalizer.cc

Issue 1588723002: Allow super type to be malformed (fixes issue 25426). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: safer alternative fix Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/code_generator.h" 7 #include "vm/code_generator.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2652 const Library& library = Library::Handle(zone, cls.library()); 2652 const Library& library = Library::Handle(zone, cls.library());
2653 ASSERT(!library.IsNull()); 2653 ASSERT(!library.IsNull());
2654 const Script& script = Script::Handle(zone, cls.script()); 2654 const Script& script = Script::Handle(zone, cls.script());
2655 ASSERT(!script.IsNull()); 2655 ASSERT(!script.IsNull());
2656 const GrowableObjectArray& type_args = 2656 const GrowableObjectArray& type_args =
2657 GrowableObjectArray::Handle(zone, GrowableObjectArray::New()); 2657 GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
2658 AbstractType& mixin_super_type = 2658 AbstractType& mixin_super_type =
2659 AbstractType::Handle(zone, mixin_app_type.super_type()); 2659 AbstractType::Handle(zone, mixin_app_type.super_type());
2660 ResolveType(cls, mixin_super_type); 2660 ResolveType(cls, mixin_super_type);
2661 ASSERT(mixin_super_type.HasResolvedTypeClass()); // Even if malformed. 2661 ASSERT(mixin_super_type.HasResolvedTypeClass()); // Even if malformed.
2662 if (mixin_super_type.IsMalformedOrMalbounded()) {
2663 ReportError(Error::Handle(zone, mixin_super_type.error()));
2664 }
2665 if (mixin_super_type.IsDynamicType()) {
2666 ReportError(cls, cls.token_pos(),
2667 "class '%s' may not extend 'dynamic'",
2668 String::Handle(zone, cls.Name()).ToCString());
2669 }
2662 // The super type may have a BoundedType as type argument, but cannot be 2670 // The super type may have a BoundedType as type argument, but cannot be
2663 // a BoundedType itself. 2671 // a BoundedType itself.
2664 CollectTypeArguments(cls, Type::Cast(mixin_super_type), type_args); 2672 CollectTypeArguments(cls, Type::Cast(mixin_super_type), type_args);
2665 AbstractType& mixin_type = AbstractType::Handle(zone); 2673 AbstractType& mixin_type = AbstractType::Handle(zone);
2666 Class& mixin_type_class = Class::Handle(zone); 2674 Class& mixin_type_class = Class::Handle(zone);
2667 Class& mixin_app_class = Class::Handle(zone); 2675 Class& mixin_app_class = Class::Handle(zone);
2668 String& mixin_app_class_name = String::Handle(zone); 2676 String& mixin_app_class_name = String::Handle(zone);
2669 String& mixin_type_class_name = String::Handle(zone); 2677 String& mixin_type_class_name = String::Handle(zone);
2670 AbstractType& super_type_arg = AbstractType::Handle(zone); 2678 AbstractType& super_type_arg = AbstractType::Handle(zone);
2671 AbstractType& mixin_type_arg = AbstractType::Handle(zone); 2679 AbstractType& mixin_type_arg = AbstractType::Handle(zone);
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
3223 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); 3231 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields());
3224 field ^= fields_array.At(0); 3232 field ^= fields_array.At(0);
3225 ASSERT(field.Offset() == ByteBuffer::data_offset()); 3233 ASSERT(field.Offset() == ByteBuffer::data_offset());
3226 name ^= field.name(); 3234 name ^= field.name();
3227 expected_name ^= String::New("_data"); 3235 expected_name ^= String::New("_data");
3228 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); 3236 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
3229 #endif 3237 #endif
3230 } 3238 }
3231 3239
3232 } // namespace dart 3240 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698