Chromium Code Reviews| Index: runtime/lib/mirrors.cc |
| diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc |
| index 8e71843f3658c413e8296de0b1773510289887db..467a13b6cca9390c75108c70bc8d5e8ac7c59ccb 100644 |
| --- a/runtime/lib/mirrors.cc |
| +++ b/runtime/lib/mirrors.cc |
| @@ -1410,11 +1410,31 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invokeConstructor, 5) { |
| UNREACHABLE(); |
| } |
| + ASSERT(!type.IsNull()); |
| + AbstractTypeArguments& type_arguments = |
| + AbstractTypeArguments::Handle(type.arguments()); |
| + |
| Class& redirected_klass = Class::Handle(klass.raw()); |
| Function& redirected_constructor = Function::Handle(lookup_constructor.raw()); |
| if (lookup_constructor.IsRedirectingFactory()) { |
| ClassFinalizer::ResolveRedirectingFactory(klass, lookup_constructor); |
| - Type& type = Type::Handle(lookup_constructor.RedirectionType()); |
| + Type& redirect_type = Type::Handle(lookup_constructor.RedirectionType()); |
| + |
| + if (!redirect_type.IsMalformed() && !redirect_type.IsInstantiated()) { |
| + // The type arguments of the redirection type are instantiated from the |
| + // type arguments of the parsed type of the 'new' or 'const' expression. |
| + Error& malformed_error = Error::Handle(); |
|
regis
2013/10/01 18:01:53
Actually, this can only be a bound_error, not malf
rmacnak
2013/10/01 18:23:12
Done. Was from the parser code for new.
|
| + redirect_type ^= redirect_type.InstantiateFrom(type_arguments, |
| + &malformed_error); |
| + if (!malformed_error.IsNull()) { |
| + ThrowInvokeError(malformed_error); |
| + UNREACHABLE(); |
| + } |
| + } |
| + |
| + type = redirect_type.raw(); |
| + type_arguments = redirect_type.arguments(); |
| + |
| redirected_constructor = lookup_constructor.RedirectionTarget(); |
| ASSERT(!redirected_constructor.IsNull()); |
| redirected_klass = type.type_class(); |
| @@ -1451,10 +1471,6 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invokeConstructor, 5) { |
| UNREACHABLE(); |
| } |
| - ASSERT(!type.IsNull()); |
| - const AbstractTypeArguments& type_arguments = |
| - AbstractTypeArguments::Handle(type.arguments()); |
| - |
| Instance& new_object = Instance::Handle(); |
| if (redirected_constructor.IsConstructor()) { |
| // Constructors get the uninitialized object and a constructor phase. Note |