[fpc-pascal] Stack alignmennt in call from C++ to FPC

Josue Andrade Gomes josuegomes at gmail.com
Fri Jun 7 15:03:42 CEST 2013

On Thu, Jun 6, 2013 at 11:09 AM, Josue Andrade Gomes
<josuegomes at gmail.com> wrote:

I reproduced the problem with a small Lazarus application. The crash
occurs inside fpc_popaddrstack.

  0x40b750 <fpc_popaddrstack+48>          jmp    0x40b759 <fpc_popaddrstack+5
  0x40b752 <fpc_popaddrstack+50>          mov    (%ebx),%eax
> 0x40b754 <fpc_popaddrstack+52>          mov    0x4(%eax),%eax
  0x40b757 <fpc_popaddrstack+55>          mov    %eax,(%ebx)
  0x40b759 <fpc_popaddrstack+57>          mov    (%esp),%ebx
  0x40b75c <fpc_popaddrstack+60>          add    $0x4,%esp
  0x40b75f <fpc_popaddrstack+63>          ret

I also found this http://comments.gmane.org/gmane.comp.ide.lazarus.general/68243

Could be related? Any ideas?

Sourcecode for my tests can be found at:  www.josuegomes.com/fp-msvc.zip


More information about the fpc-pascal mailing list