From 1a1af3a6604e294c3b3199d2c2f7562d6144222f Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Sun, 22 Jul 2007 19:30:26 +0000 Subject: [PATCH] 2007-07-22 Zoltan Varga * 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 | 6 ++++++ mono/mini/exceptions-x86.c | 3 ++- mono/mini/tramp-x86.c | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index 7b789320372..b4c9fa1cc43 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,5 +1,11 @@ 2007-07-22 Zoltan Varga + * 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. diff --git a/mono/mini/exceptions-x86.c b/mono/mini/exceptions-x86.c index 193f059acd7..7e614b9e348 100644 --- a/mono/mini/exceptions-x86.c +++ b/mono/mini/exceptions-x86.c @@ -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); diff --git a/mono/mini/tramp-x86.c b/mono/mini/tramp-x86.c index 5612cfac999..8310a72521d 100644 --- a/mono/mini/tramp-x86.c +++ b/mono/mini/tramp-x86.c @@ -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++; -- 2.25.1