[patch libffi]: Fix _ffi_call_win64 stack allocation

Kai Tietz ktietz70@googlemail.com
Mon Sep 28 22:28:00 GMT 2009


2009/9/28 Anthony Green <green@redhat.com>:
> Kai Tietz wrote:
>>
>> Hello,
>>
>> this patch fixes a stack allocation bug in _ffi_call_win64. The issue
>> is that the stack was one time allocated by ___chkstk and then again
>> stack was probed and allocated by a random value of %rax. Gcc's
>> ___chkstk isn't the same as VC's. VC's version just probes the given
>> size in %rax on stack, but doesn't allocate it, but gcc's version
>> probes and allocates. Also VC's version doesn't clobber any register,
>> but gcc's version clobbers rax, r10, and r11. For more details see
>> gcc/config/i386/cygwin.asm file.
>>
>> ChangeLog
>>
>> 2009-09-28  Kai Tietz  <kai.tietz@onevision.com>
>>
>>        * src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu
>>        assembly version use of ___chkstk.
>>
>> Tested for x86_64-pc-mingw32 without regressions. Ok for apply?
>>
>
> Yes, thanks.
>
> AG
>
>
>> Kai
>>
>>
>
>

Applied to gcc's trunk at revision 152256. For libffi trunk I have no
write-privileges.

Thanks,
Kai


-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination



More information about the Gcc-patches mailing list