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

Unified Diff: runtime/vm/code_generator.cc

Issue 8329005: Replace calls to Class::IsParameterized() by either (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
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()) {

Powered by Google App Engine
This is Rietveld 408576698