This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch libffi]: Fix _ffi_call_win64 stack allocation


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]