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

Side by Side Diff: runtime/lib/mirrors.cc

Issue 66033006: Check type bounds of redirecting factories (issue 14699). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/vm/ast.h » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "lib/invocation_mirror.h" 5 #include "lib/invocation_mirror.h"
6 #include "vm/bootstrap_natives.h" 6 #include "vm/bootstrap_natives.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 1662
1663 Class& redirected_klass = Class::Handle(klass.raw()); 1663 Class& redirected_klass = Class::Handle(klass.raw());
1664 Function& redirected_constructor = Function::Handle(lookup_constructor.raw()); 1664 Function& redirected_constructor = Function::Handle(lookup_constructor.raw());
1665 if (lookup_constructor.IsRedirectingFactory()) { 1665 if (lookup_constructor.IsRedirectingFactory()) {
1666 ClassFinalizer::ResolveRedirectingFactory(klass, lookup_constructor); 1666 ClassFinalizer::ResolveRedirectingFactory(klass, lookup_constructor);
1667 Type& redirect_type = Type::Handle(lookup_constructor.RedirectionType()); 1667 Type& redirect_type = Type::Handle(lookup_constructor.RedirectionType());
1668 1668
1669 if (!redirect_type.IsInstantiated()) { 1669 if (!redirect_type.IsInstantiated()) {
1670 // The type arguments of the redirection type are instantiated from the 1670 // The type arguments of the redirection type are instantiated from the
1671 // type arguments of the type reflected by the class mirror. 1671 // type arguments of the type reflected by the class mirror.
1672 Error& malformed_error = Error::Handle(); 1672 Error& bound_error = Error::Handle();
1673 redirect_type ^= redirect_type.InstantiateFrom(type_arguments, 1673 redirect_type ^= redirect_type.InstantiateFrom(type_arguments,
1674 &malformed_error); 1674 &bound_error);
1675 if (!malformed_error.IsNull()) { 1675 if (!bound_error.IsNull()) {
1676 ThrowInvokeError(malformed_error); 1676 ThrowInvokeError(bound_error);
1677 UNREACHABLE(); 1677 UNREACHABLE();
1678 } 1678 }
1679 } 1679 }
1680 1680
1681 type = redirect_type.raw(); 1681 type = redirect_type.raw();
1682 type_arguments = redirect_type.arguments(); 1682 type_arguments = redirect_type.arguments();
1683 1683
1684 redirected_constructor = lookup_constructor.RedirectionTarget(); 1684 redirected_constructor = lookup_constructor.RedirectionTarget();
1685 ASSERT(!redirected_constructor.IsNull()); 1685 ASSERT(!redirected_constructor.IsNull());
1686 redirected_klass = type.type_class(); 1686 redirected_klass = type.type_class();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1955 1955
1956 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) { 1956 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) {
1957 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); 1957 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
1958 const Field& field = Field::Handle(ref.GetFieldReferent()); 1958 const Field& field = Field::Handle(ref.GetFieldReferent());
1959 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1)); 1959 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1));
1960 const AbstractType& type = AbstractType::Handle(field.type()); 1960 const AbstractType& type = AbstractType::Handle(field.type());
1961 return InstantiateType(type, instantiator); 1961 return InstantiateType(type, instantiator);
1962 } 1962 }
1963 1963
1964 } // namespace dart 1964 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/vm/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698