2009-02-22 Mark Probst <mark.probst@gmail.com>
authorMark Probst <mark.probst@gmail.com>
Sun, 22 Feb 2009 20:49:26 +0000 (20:49 -0000)
committerMark Probst <mark.probst@gmail.com>
Sun, 22 Feb 2009 20:49:26 +0000 (20:49 -0000)
* tramp-ppc.c (mono_arch_create_trampoline_code): Store the
correct frame pointer in the LMF.  Should fix #478394.

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

mono/mini/ChangeLog
mono/mini/tramp-ppc.c

index 38b4578b84bf5e033c07ae7b628328cd8313d477..668c3a6c9e2eae49ff987341bbd2870bdb5a689d 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-22  Mark Probst  <mark.probst@gmail.com>
+
+       * tramp-ppc.c (mono_arch_create_trampoline_code): Store the
+       correct frame pointer in the LMF.  Should fix #478394.
+
 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
 
        * Makefile.am (fullaotcheck): Copy Mono.Simd.dll as well.
index 800cbc10c4aec092b224b82f416bf282dd696dc9..dd23ff42f1a3b08e8f99c5f385700d0fa474c6eb 100644 (file)
@@ -174,7 +174,7 @@ mono_arch_create_trampoline_code (MonoTrampolineType tramp_type)
        guint8 *buf, *code = NULL;
        int i, offset;
        gconstpointer tramp_handler;
-       int size = MONO_PPC_32_64_CASE (512, 688);
+       int size = MONO_PPC_32_64_CASE (516, 692);
 
        /* Now we'll create in 'buf' the PowerPC trampoline code. This
           is the trampoline code common to all methods  */
@@ -241,7 +241,9 @@ mono_arch_create_trampoline_code (MonoTrampolineType tramp_type)
                ppc_load_reg (buf, ppc_r5, GREGS_OFFSET, ppc_r1);
        if ((tramp_type == MONO_TRAMPOLINE_JIT) || (tramp_type == MONO_TRAMPOLINE_JUMP))
                ppc_store_reg (buf, ppc_r5, G_STRUCT_OFFSET(MonoLMF, method), ppc_r11);
-       ppc_store_reg (buf, ppc_sp, G_STRUCT_OFFSET(MonoLMF, ebp), ppc_r11);
+       /* store the frame pointer of the calling method */
+       ppc_addi (buf, ppc_r0, ppc_sp, STACK);
+       ppc_store_reg (buf, ppc_r0, G_STRUCT_OFFSET(MonoLMF, ebp), ppc_r11);
        /* save the IP (caller ip) */
        if (tramp_type == MONO_TRAMPOLINE_JUMP) {
                ppc_li (buf, ppc_r0, 0);