2004-11-24 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Wed, 24 Nov 2004 15:02:36 +0000 (15:02 -0000)
committerMartin Baulig <martin@novell.com>
Wed, 24 Nov 2004 15:02:36 +0000 (15:02 -0000)
* 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

mono/mini/ChangeLog
mono/mini/mini.c

index b41597023ee4297b7b35917a47ded5605cc5ced6..bbfad41e30c81c0f9dfde9aef8a42c9f73e03063 100644 (file)
@@ -1,3 +1,8 @@
+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
index 1f2c5f6a65ce68c52a7eabc5932783aadd592144..cd285989b74c119cea51cc20e1ab4541bed133a3 100644 (file)
@@ -963,12 +963,17 @@ handle_enum:
  * 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:
@@ -1007,7 +1012,7 @@ handle_enum:
                        type = type->data.klass->enum_basetype;
                        goto handle_enum;
                } else {
-                       inst->klass = type->data.klass;
+                       inst->klass = klass;
                        inst->type = STACK_VTYPE;
                        return;
                }