Skip to content

Commit

Permalink
2003-09-07 Martin Baulig <martin@ximian.com>
Browse files Browse the repository at this point in the history
	* class.c (mono_class_init): If we're a generic instance, inflate
	all our methods instead of loading them from the image.
	(mono_class_from_generic): Set `class->methods = gklass->methods'.

svn path=/trunk/mono/; revision=17970
  • Loading branch information
Martin Baulig committed Sep 7, 2003
1 parent 1f4f9fb commit b6a65fd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions mono/metadata/ChangeLog
@@ -1,3 +1,9 @@
2003-09-07 Martin Baulig <martin@ximian.com>

* class.c (mono_class_init): If we're a generic instance, inflate
all our methods instead of loading them from the image.
(mono_class_from_generic): Set `class->methods = gklass->methods'.

2003-09-07 Martin Baulig <martin@ximian.com>

* mono-debug-debugger.c: Added support for constructors.
Expand Down
12 changes: 7 additions & 5 deletions mono/metadata/class.c
Expand Up @@ -1142,17 +1142,18 @@ mono_class_init (MonoClass *class)
class->methods [1] = ctor;
}
} else {
class->methods = g_new (MonoMethod*, class->method.count);
for (i = 0; i < class->method.count; ++i) {
class->methods [i] = mono_get_method (class->image,
MONO_TOKEN_METHOD_DEF | (i + class->method.first + 1), class);
}
if (class->generic_inst) {
for (i = 0; i < class->method.count; ++i) {
class->methods [i] = inflate_generic_method (class->methods [i], class->generic_inst->data.generic_inst, NULL);
class->methods [i]->klass = class;
/*g_print ("inflated method %s in %s\n", class->methods [i]->name, class->name);*/
}
} else {
class->methods = g_new (MonoMethod*, class->method.count);
for (i = 0; i < class->method.count; ++i) {
class->methods [i] = mono_get_method (class->image,
MONO_TOKEN_METHOD_DEF | (i + class->method.first + 1), class);
}
}
}

Expand Down Expand Up @@ -1613,6 +1614,7 @@ mono_class_from_generic (MonoType *gtype)

class->field = gklass->field;
class->method = gklass->method;
class->methods = gklass->methods;

/*g_print ("instantiating class from %s.%s to %s\n", gklass->name_space, gklass->name, class->name);
g_print ("methods: %d, fields: %d\n", class->method.count, class->field.count);*/
Expand Down

0 comments on commit b6a65fd

Please sign in to comment.