mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-12 20:31:55 -08:00
Do not use calling convention for dynamic call of C functions: save/restore the stack pointer manually, which work in all cases.
This commit is contained in:
parent
0300955bf2
commit
2301f0ceed
1 changed files with 4 additions and 4 deletions
|
|
@ -58,9 +58,11 @@ ecl_fficall_execute(void *f_ptr, struct ecl_fficall *fficall, enum ecl_ffi_tag r
|
|||
#ifdef _MSC_VER
|
||||
int bufsize = fficall->buffer_size;
|
||||
char* buf = fficall->buffer;
|
||||
char* stack_p;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov stack_p,esp
|
||||
sub esp,bufsize
|
||||
mov esi,buf
|
||||
mov edi,esp
|
||||
|
|
@ -92,13 +94,11 @@ ecl_fficall_execute(void *f_ptr, struct ecl_fficall *fficall, enum ecl_ffi_tag r
|
|||
((void (*)())f_ptr)();
|
||||
}
|
||||
|
||||
if (fficall->cc == ECL_FFI_CC_CDECL) {
|
||||
#ifdef _MSC_VER
|
||||
__asm add esp,bufsize
|
||||
__asm mov esp,stack_p
|
||||
#else
|
||||
sp += fficall->buffer_size;
|
||||
sp += fficall->buffer_size;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue