[Mono-dev] [PATCH] Win32 pinvoke3 runtime tests fixes

Zoltan Varga vargaz at gmail.com
Mon Jul 28 17:12:44 EDT 2008


Hi,

2008/7/28 Bill Holmes <billholmes54 at gmail.com>:
> Hello All,
>
> I am sending an update to this patch since there have been some
> discussion since the original posting.
>
> The 2 changes since the previous patch are in mono_arch_emit_epilog.
>
> @@ -4186,6 +4192,11 @@
>                }
>        }
>
> +       if (MONO_TYPE_ISSTRUCT (mono_method_signature (cfg->method)->ret) &&
> (cinfo->ret.storage == ArgOnStack) && (cfg->vret_addr)) {
> +               /* When return structs are passed on the stack the address needs to
> be stored in eax. */
> +               x86_mov_reg_membase (code, X86_EAX, cfg->vret_addr->sreg1,
> cfg->vret_addr->inst_offset, sizeof (gpointer));
> +       }
> +
>        x86_leave (code);
>
>        if (CALLCONV_IS_STDCALL (sig)) {
>
> It was brought to my attention on IRC that the address of the return
> struct needs to be in the return register for more platforms than just
> Win32.   I removed the 'if Win32' preprocessor check so that this
> occurs on all platforms.
>

What platforms needs this ? It doesn't look like it is needed on
linux. Also, this should
only be needed for methods which can be called from native code (
method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED).

Other than that, the patch look ok to me.

                     Zoltan


More information about the Mono-devel-list mailing list