2007-07-22 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Sun, 22 Jul 2007 19:30:26 +0000 (19:30 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sun, 22 Jul 2007 19:30:26 +0000 (19:30 -0000)
* exceptions-x86.c (mono_arch_find_jit_info): Handle the lmf->method == NULL
case.

* tramp-x86.c (mono_arch_create_trampoline_code): Only set lmf->method for
trampolines taking a method argument.

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

mono/mini/ChangeLog
mono/mini/exceptions-x86.c
mono/mini/tramp-x86.c

index 7b7893203727fe4789d0c5b7496ab3987dd1cc6d..b4c9fa1cc43a2f878e9c9af5b01b383262e9ca5d 100644 (file)
@@ -1,5 +1,11 @@
 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
 
+       * exceptions-x86.c (mono_arch_find_jit_info): Handle the lmf->method == NULL
+       case.
+
+       * tramp-x86.c (mono_arch_create_trampoline_code): Only set lmf->method for
+       trampolines taking a method argument.
+
        * mini-x86.h (MonoLMF): Add an 'esp' field plus comments.
 
        * mini-x86.c (mono_arch_emit_prolog): Update after changes to the LMF structure.
index 193f059acd7d06d1302a88d97c637b36f2922584..7e614b9e3483701f1d0195e04cab30035494eaae 100644 (file)
@@ -667,7 +667,8 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
                        new_ctx->esp = (*lmf)->esp;
 
                        /* Pop arguments off the stack */
-                       {
+                       /* FIXME: Handle the delegate case too ((*lmf)->method == NULL) */
+                       if ((*lmf)->method) {
                                MonoMethod *method = (*lmf)->method;
                                MonoJitArgumentInfo *arg_info = g_newa (MonoJitArgumentInfo, mono_method_signature (method)->param_count + 1);
 
index 5612cfac9998057ef862bba426d4ba8f446526a3..8310a72521db30f70736acb97d6b1511a3ad82de 100644 (file)
@@ -226,7 +226,10 @@ mono_arch_create_trampoline_code (MonoTrampolineType tramp_type)
        pushed_args ++;
 
        /* save method info */
-       x86_push_membase (buf, X86_ESP, pushed_args * sizeof (gpointer));
+       if ((tramp_type == MONO_TRAMPOLINE_GENERIC) || (tramp_type == MONO_TRAMPOLINE_JUMP))
+               x86_push_membase (buf, X86_ESP, pushed_args * sizeof (gpointer));
+       else
+               x86_push_imm (buf, 0);
 
        pushed_args++;