2009-09-29 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Tue, 29 Sep 2009 20:06:34 +0000 (20:06 -0000)
committerZoltan Varga <vargaz@gmail.com>
Tue, 29 Sep 2009 20:06:34 +0000 (20:06 -0000)
* mini-sparc.c: Fix the handling of enums with base type long.

svn path=/trunk/mono/; revision=142918

mono/mini/ChangeLog
mono/mini/mini-sparc.c

index e962d0f37ff2e90b472d2c77b906af974725ed17..e43283d1bfdd33df2acaac6bd704d1d4abab2e7a 100644 (file)
@@ -1,5 +1,7 @@
 2009-09-29  Zoltan Varga  <vargaz@gmail.com>
 
+       * mini-sparc.c: Fix the handling of enums with base type long.
+
        * mini-sparc.c (mono_arch_output_basic_block): Fix IREM_UN_IMM.
 
        * mini-sparc.c (mono_arch_allocate_vars): Use mono_class_from_mono_type ()
index c85c97c4b64101a552ceb837657ff806dcd53ac2..1650395fdcb522729e6056e5a14d213b85edf56c 100644 (file)
@@ -811,8 +811,9 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                        cfg->ret->opcode = OP_REGVAR;
                        cfg->ret->inst_c0 = cinfo->ret.reg;
                        break;
-               case ArgInIRegPair:
-                       if (((sig->ret->type == MONO_TYPE_I8) || (sig->ret->type == MONO_TYPE_U8))) {
+               case ArgInIRegPair: {
+                       MonoType *t = mono_type_get_underlying_type (sig->ret);
+                       if (((t->type == MONO_TYPE_I8) || (t->type == MONO_TYPE_U8))) {
                                MonoInst *low = get_vreg_to_inst (cfg, cfg->ret->dreg + 1);
                                MonoInst *high = get_vreg_to_inst (cfg, cfg->ret->dreg + 2);
 
@@ -824,6 +825,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                        cfg->ret->opcode = OP_REGVAR;
                        cfg->ret->inst_c0 = cinfo->ret.reg;
                        break;
+               }
                case ArgOnStack:
 #ifdef SPARCV9
                        g_assert_not_reached ();
@@ -1313,6 +1315,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
                else
                        arg_type = sig->params [i - sig->hasthis];
 
+               arg_type = mono_type_get_underlying_type (arg_type);
                if ((i >= sig->hasthis) && (MONO_TYPE_ISSTRUCT(sig->params [i - sig->hasthis])))
                        emit_pass_vtype (cfg, call, cinfo, ainfo, arg_type, in, sig->pinvoke);
                else if (!arg_type->byref && ((arg_type->type == MONO_TYPE_I8) || (arg_type->type == MONO_TYPE_U8)))