From ea4e68bd29728ee9a601f2fbd16ecc89a1c79b7e Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 24 Nov 2004 15:02:36 +0000 Subject: [PATCH] 2004-11-24 Martin Baulig * 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 | 5 +++++ mono/mini/mini.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index b41597023ee..bbfad41e30c 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,3 +1,8 @@ +2004-11-24 Martin Baulig + + * 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 * mini.c (mono_method_to_ir): Use `STACK_OBJ' instead of diff --git a/mono/mini/mini.c b/mono/mini/mini.c index 1f2c5f6a65c..cd285989b74 100644 --- a/mono/mini/mini.c +++ b/mono/mini/mini.c @@ -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; } -- 2.25.1