mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +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__(
|
||||
"mov %0, %%edx \n"
|
||||
"popl %%ebp \n"
|
||||
// "popl %%ebp \n"
|
||||
"leave \n"
|
||||
"popl %%ecx \n"
|
||||
"subl %%edx, %%esp \n"
|
||||
"movl %%esp, %%eax \n"
|
||||
"addl $4, %%eax \n"
|
||||
"addl $20, %%eax \n"//4 bytes + 16 bytes = arguments
|
||||
"push %%ecx \n"
|
||||
"ret \n"
|
||||
:
|
||||
|
@ -70,12 +70,12 @@ void *_alloca(size_t s)
|
|||
|
||||
__asm__ __volatile__(
|
||||
"mov %0, %%edx \n"
|
||||
"popl %%ebp \n"
|
||||
// "popl %%ebp \n"
|
||||
"leave \n"
|
||||
"popl %%ecx \n"
|
||||
"subl %%edx, %%esp \n"
|
||||
"movl %%esp, %%eax \n"
|
||||
"addl $4, %%eax \n"
|
||||
"addl $20, %%eax \n"//4 bytes + 16 bytes = arguments
|
||||
"push %%ecx \n"
|
||||
"ret \n"
|
||||
:
|
||||
|
|
Loading…
Reference in a new issue