Author: lupus
Date: 2007-10-08 08:13:22 -0400 (Mon, 08 Oct 2007)
New Revision: 87089

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/tramp-amd64.c
Log:



Mon Oct 8 14:25:39 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>

        * tramp-amd64.c: fixed memory corruption in the trampoline generation.



Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2007-10-08 12:08:12 UTC (rev 87088)
+++ trunk/mono/mono/mini/ChangeLog      2007-10-08 12:13:22 UTC (rev 87089)
@@ -1,4 +1,9 @@
 
+
+Mon Oct 8 14:25:39 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
+
+       * tramp-amd64.c: fixed memory corruption in the trampoline generation.
+
 Mon Oct 8 12:06:33 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
 
        * tramp-ppc.c, tramp-x86.c: reduce the alignment requirements for

Modified: trunk/mono/mono/mini/tramp-amd64.c
===================================================================
--- trunk/mono/mono/mini/tramp-amd64.c  2007-10-08 12:08:12 UTC (rev 87088)
+++ trunk/mono/mono/mini/tramp-amd64.c  2007-10-08 12:13:22 UTC (rev 87089)
@@ -345,7 +345,12 @@
        }
 
        jump_offset = code - buf;
-       amd64_jump_disp (code, 0xffffffff);
+       /* note that jump_disp can use a 8 bit displacement immediate, so we
+        * need to use a value doesn't fit into signed 8 bits otherwise the
+        * later amd64_jump_disp (code, tramp - code) call will corrupt memory
+        * as we allocate 3 bytes less.
+        */
+       amd64_jump_disp (code, 0xf1f1f1f1);
 
        g_assert ((code - buf) <= TRAMPOLINE_SIZE);
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to