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]: Add thiscall-closure support for fixing regression PR/51500


2012/1/31 Uros Bizjak <ubizjak@gmail.com>:
> On Tue, Jan 31, 2012 at 10:51 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>> Ok, this variant keeps 16-byte alignment for thiscall-closure.
>
> It doesn't. You have to account for the fact that caller pushed return
> address to the stack, so %esp was already decreased by 4 behind your
> back. To maintain alignment, you have to decrease %esp by $12, not by
> $16.
>
> Uros.

Ah, I got you.  Right before call stack is aligned, in call we have
unaligned return-address already on stack.  I fix that

Kai


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