Chromium Code Reviews| Index: runtime/vm/code_generator.cc |
| =================================================================== |
| --- runtime/vm/code_generator.cc (revision 502) |
| +++ runtime/vm/code_generator.cc (working copy) |
| @@ -149,7 +149,8 @@ |
| const Class& cls = Class::CheckedHandle(arguments.At(0)); |
| const Instance& instance = Instance::Handle(Instance::New(cls)); |
| arguments.SetReturn(instance); |
| - if (!cls.IsParameterized()) { |
| + const intptr_t num_type_arguments = cls.NumTypeArguments(); |
| + if (num_type_arguments > 0) { |
|
siva
2011/10/18 05:06:19
The comment and code in the if statement is not ma
regis
2011/10/18 17:28:21
Good catch. I think we avoided this new bug, becau
|
| // No type arguments required for a non-parameterized type. |
| ASSERT(Instance::CheckedHandle(arguments.At(1)).IsNull()); |
| return; |
| @@ -160,7 +161,7 @@ |
| ASSERT(Instance::CheckedHandle(arguments.At(2)).IsNull()); |
| return; |
| } |
| - ASSERT(type_arguments.Length() == cls.NumTypeArguments()); |
| + ASSERT(type_arguments.Length() == num_type_arguments); |
| const TypeArguments& instantiator = |
| TypeArguments::CheckedHandle(arguments.At(2)); |
| if (instantiator.IsNull()) { |