2010-06-19 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Sat, 19 Jun 2010 00:59:57 +0000 (00:59 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sat, 19 Jun 2010 00:59:57 +0000 (00:59 -0000)
* tramp-amd64.c (mono_arch_create_generic_trampoline): Increase the buf len a little,
to avoid an assert.

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

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

index f236c8525003555a1935a76d8e71e9b2e5b9117b..352dd678a5e092b10c7c4201fe9c89aa12c2aed9 100755 (executable)
@@ -1,3 +1,8 @@
+2010-06-19  Zoltan Varga  <vargaz@gmail.com>
+
+       * tramp-amd64.c (mono_arch_create_generic_trampoline): Increase the buf len a little,
+       to avoid an assert.
+
 2010-06-18  Zoltan Varga  <vargaz@gmail.com>
 
        * aot-compiler.c (emit_klass_info): Mark unloadable classes properly.
index 985c868f8ef70a46614e5a7afcb3b22e60bdec16..fe966b89bbe2ce26604e0252485d3615f94bf265 100644 (file)
@@ -284,7 +284,8 @@ guchar*
 mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
 {
        guint8 *buf, *code, *tramp, *br [2], *r11_save_code, *after_r11_save_code;
-       int i, lmf_offset, offset, res_offset, arg_offset, rax_offset, tramp_offset, saved_regs_offset;
+       int i, lmf_offset, offset, res_offset, arg_offset, rax_offset, tramp_offset;
+       int buf_len, saved_regs_offset;
        int saved_fpregs_offset, rbp_offset, framesize, orig_rsp_to_rbp_offset, cfa_offset;
        gboolean has_caller;
        GSList *unwind_ops = NULL;
@@ -295,7 +296,8 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        else
                has_caller = TRUE;
 
-       code = buf = mono_global_codeman_reserve (538);
+       buf_len = 548;
+       code = buf = mono_global_codeman_reserve (buf_len);
 
        framesize = 538 + sizeof (MonoLMF);
        framesize = (framesize + (MONO_ARCH_FRAME_ALIGNMENT - 1)) & ~ (MONO_ARCH_FRAME_ALIGNMENT - 1);
@@ -545,7 +547,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                amd64_jump_membase (code, AMD64_RSP, rax_offset - 0x8);
        }
 
-       g_assert ((code - buf) <= 538);
+       g_assert ((code - buf) <= buf_len);
 
        mono_arch_flush_icache (buf, code - buf);