Sat Apr 6 16:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Sat, 6 Apr 2002 10:40:58 +0000 (10:40 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Sat, 6 Apr 2002 10:40:58 +0000 (10:40 -0000)
* x86/tramp.c: fix advancement od argument position on the stack.

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

mono/arch/ChangeLog
mono/arch/x86/tramp.c

index 48b847d6eb685193e60ce61b9916751d3898f062..4b6b91e2c97df0ac141215954e0807f01a7b2326 100644 (file)
@@ -1,4 +1,8 @@
 
+Sat Apr 6 16:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+       * x86/tramp.c: fix advancement od argument position on the stack.
+
 Sat Mar 16 19:12:57 CET 2002 Paolo Molaro <lupus@ximian.com>
 
        * x86/tramp.c: increase default allocated size for trampolines
index 620aad25f1164db2bf7a7c34538ff333bc0c8d20..74c5eba8d70491e00d8d71b43f27203ee1795721 100644 (file)
@@ -376,7 +376,7 @@ mono_create_method_pointer (MonoMethod *method)
        unsigned char *p, *code_buffer;
        gint32 local_size;
        gint32 stackval_pos, arg_pos = 8;
-       int i;
+       int i, align;
 
        /*
         * If it is a static P/Invoke method, we can just return the pointer
@@ -444,19 +444,7 @@ mono_create_method_pointer (MonoMethod *method)
                x86_call_reg (p, X86_ECX);
                x86_alu_reg_imm (p, X86_SUB, X86_ESP, 12);
                stackval_pos += sizeof (stackval);
-               arg_pos += 4;
-               if (!sig->params [i]->byref) {
-                       switch (sig->params [i]->type) {
-                       case MONO_TYPE_I8:
-                       case MONO_TYPE_R8:
-                               arg_pos += 4;
-                               break;
-                       case MONO_TYPE_VALUETYPE:
-                               g_assert_not_reached (); /* Not implemented yet. */
-                       default:
-                               break;
-                       }
-               }
+               arg_pos += mono_type_stack_size (sig->params [i], &align);
        }
 
        /*