Fix i386 alloca code.
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled

I commited the wrong version in previous commit.
This commit is contained in:
herman ten brugge 2025-08-03 18:41:32 +02:00
parent 6694391b74
commit 5364bc7c82
2 changed files with 16 additions and 15 deletions

View File

@ -15,10 +15,10 @@ _(__bound_alloca):
pop %edx
pop %eax
mov %eax, %ecx
test %eax,%eax
jz p6
add $15+1,%eax
and $-16,%eax
sub $4,%eax
jz p6
#ifdef _WIN32
p4:
@ -33,6 +33,7 @@ p5:
#endif
sub %eax,%esp
and $-16,%esp
mov %esp,%eax
push %edx

View File

@ -13,28 +13,28 @@
.globl _(alloca), _(__alloca)
_(alloca):
_(__alloca):
push %ebp
mov %esp,%ebp
mov 8(%ebp),%eax
pop %edx
pop %eax
add $15,%eax
and $-16,%eax
sub $4,%eax
jz p3
#ifdef _WIN32
jmp .+16 #p2
p1:
cmp $4096,%eax
jbe p2
test %eax,-4096(%esp)
sub $4096,%esp
sub $4096,%eax
test %eax,(%esp)
jmp p1
p2:
cmp $4096,%eax
jae p1
#endif
sub %eax,%esp
mov 4(%ebp),%eax
mov 0(%ebp),%ebp
add $8,%esp
push %eax
lea 8(%esp),%eax
and $-16,%esp
mov %esp,%eax
p3:
push %edx
push %edx
ret
/* ---------------------------------------------- */