mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-15 05:20:06 +08:00
Fix alloca on x86_64 windows
This commit is contained in:
parent
a0bc149b0c
commit
426d32af23
@ -5,7 +5,6 @@
|
|||||||
__bound_alloca:
|
__bound_alloca:
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# bound checking is not implemented
|
|
||||||
pop %rdx
|
pop %rdx
|
||||||
mov %rcx,%rax
|
mov %rcx,%rax
|
||||||
add $15,%rax
|
add $15,%rax
|
||||||
@ -23,8 +22,18 @@ p2:
|
|||||||
|
|
||||||
sub %rax,%rsp
|
sub %rax,%rsp
|
||||||
mov %rsp,%rax
|
mov %rsp,%rax
|
||||||
add $32,%rax
|
|
||||||
|
|
||||||
|
push %rdx
|
||||||
|
push %rax
|
||||||
|
mov %rcx,%rdx
|
||||||
|
mov %rax,%rcx
|
||||||
|
sub $20,%rsp
|
||||||
|
call __bound_new_region
|
||||||
|
add $20,%rsp
|
||||||
|
pop %rax
|
||||||
|
pop %rdx
|
||||||
|
|
||||||
|
add $32,%rax
|
||||||
p3:
|
p3:
|
||||||
push %rdx
|
push %rdx
|
||||||
ret
|
ret
|
||||||
|
@ -1025,7 +1025,7 @@ void gfunc_call(int nb_args)
|
|||||||
|
|
||||||
if ((vtop->r & VT_SYM) && vtop->sym->v == TOK_alloca) {
|
if ((vtop->r & VT_SYM) && vtop->sym->v == TOK_alloca) {
|
||||||
/* need to add the "func_scratch" area after alloca */
|
/* need to add the "func_scratch" area after alloca */
|
||||||
o(0x48); func_alloca = oad(0x05, func_alloca); /* sub $NN, %rax */
|
o(0x48); func_alloca = oad(0x2d, func_alloca); /* sub $NN, %rax */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* other compilers don't clear the upper bits when returning char/short */
|
/* other compilers don't clear the upper bits when returning char/short */
|
||||||
|
Loading…
Reference in New Issue
Block a user