This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: [PATCH] don't count return value space twice on x86
- From: Timothy Wall <twall at users dot sf dot net>
- To: Dan Witte <dwitte at mozilla dot com>
- Cc: libffi-discuss <libffi-discuss at sourceware dot org>, Anthony Green <green at redhat dot com>
- Date: Wed, 04 Aug 2010 23:42:04 -0400
- Subject: Re: [PATCH] don't count return value space twice on x86
- References: <830109349.187251.1280976704717.JavaMail.root@cm-mail03.mozilla.org>
On Aug 4, 2010, at 10:51 PM, Dan Witte wrote:
> Nope, it's consistent for us. Closure returns an int32_t, building with MSVC on x86 WIN32.
>
> If it's working for you, it's likely that you're tickling (or in this case, not tickling) the platform-#ifdefed code in prep_cif. Maybe you have some custom defines or flags (or we're missing them) that cause that?
>
> If that code is getting compiled in your builds, then I'm stumped... you are building win32.S with ml, right?
>
That's a possible difference. I've built and tested using cygwing/mingw32, and only built 64-bit windows with MS tools.
> Cheers,
> Dan.
>
> ----- Original Message -----
>> I take it this is only under *some* circumstances, since I've used a
>> number of different stdcall closures without issue.
>>
>> On Aug 4, 2010, at 8:13 PM, Dan Witte wrote:
>>
>>> Anthony,
>>>
>>> There's a bug in stdcall x86 WIN32 closure code where stack space
>>> for the return value is counted twice -- which leads to overpopping
>>> and a spectacular crash. This adds an X86_ANY define for all x86
>>> plats, which simplifies logic and means that stack computation is
>>> done consistently in the x86 prep_cif_machdep, rather than
>>> double-counted by prep_cif.
>>>
>>> Look OK?
>>>
>>> Cheers,
>>> Dan.
>>> <libffi-patch-X86_ANY.diff>