* minit.c (type_to_eval_stack_type): Set `inst->klass' to the
original klass (this only applies for generic instances).
svn path=/trunk/mono/; revision=36489
+2004-11-24 Martin Baulig <martin@ximian.com>
+
+ * minit.c (type_to_eval_stack_type): Set `inst->klass' to the
+ original klass (this only applies for generic instances).
+
2004-11-24 Martin Baulig <martin@ximian.com>
* mini.c (mono_method_to_ir): Use `STACK_OBJ' instead of
* FIXME: return a MonoType/MonoClass for the byref and VALUETYPE cases.
*/
static void
-type_to_eval_stack_type (MonoType *type, MonoInst *inst) {
+type_to_eval_stack_type (MonoType *type, MonoInst *inst)
+{
+ MonoClass *klass;
+
if (type->byref) {
inst->type = STACK_MP;
return;
}
+ klass = mono_class_from_mono_type (type);
+
handle_enum:
switch (type->type) {
case MONO_TYPE_I1:
type = type->data.klass->enum_basetype;
goto handle_enum;
} else {
- inst->klass = type->data.klass;
+ inst->klass = klass;
inst->type = STACK_VTYPE;
return;
}