mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
oops! leave make a pop, and caller of alloca make esp = esp +16.
svn path=/trunk/; revision=1595
This commit is contained in:
parent
766ded4e0f
commit
47f77fa056
1 changed files with 4 additions and 4 deletions
|
@ -38,12 +38,12 @@ void *alloca(size_t s)
|
||||||
|
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
"mov %0, %%edx \n"
|
"mov %0, %%edx \n"
|
||||||
"popl %%ebp \n"
|
// "popl %%ebp \n"
|
||||||
"leave \n"
|
"leave \n"
|
||||||
"popl %%ecx \n"
|
"popl %%ecx \n"
|
||||||
"subl %%edx, %%esp \n"
|
"subl %%edx, %%esp \n"
|
||||||
"movl %%esp, %%eax \n"
|
"movl %%esp, %%eax \n"
|
||||||
"addl $4, %%eax \n"
|
"addl $20, %%eax \n"//4 bytes + 16 bytes = arguments
|
||||||
"push %%ecx \n"
|
"push %%ecx \n"
|
||||||
"ret \n"
|
"ret \n"
|
||||||
:
|
:
|
||||||
|
@ -70,12 +70,12 @@ void *_alloca(size_t s)
|
||||||
|
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
"mov %0, %%edx \n"
|
"mov %0, %%edx \n"
|
||||||
"popl %%ebp \n"
|
// "popl %%ebp \n"
|
||||||
"leave \n"
|
"leave \n"
|
||||||
"popl %%ecx \n"
|
"popl %%ecx \n"
|
||||||
"subl %%edx, %%esp \n"
|
"subl %%edx, %%esp \n"
|
||||||
"movl %%esp, %%eax \n"
|
"movl %%esp, %%eax \n"
|
||||||
"addl $4, %%eax \n"
|
"addl $20, %%eax \n"//4 bytes + 16 bytes = arguments
|
||||||
"push %%ecx \n"
|
"push %%ecx \n"
|
||||||
"ret \n"
|
"ret \n"
|
||||||
:
|
:
|
||||||
|
|
Loading…
Reference in a new issue