Fix problem using alloca function, executable crashed even with a exception handler function, when try to allocate INT_MAX. Patch provided by Jason Hood in private e-mail, when I ask to him for help. He say: Feel free to pass it on to the mailing list.
This commit is contained in:
@ -14,10 +14,10 @@ __bound_alloca:
|
|||||||
#ifdef TCC_TARGET_PE
|
#ifdef TCC_TARGET_PE
|
||||||
p4:
|
p4:
|
||||||
cmp $4096,%eax
|
cmp $4096,%eax
|
||||||
jle p5
|
jb p5
|
||||||
|
test %eax,-4096(%esp)
|
||||||
sub $4096,%esp
|
sub $4096,%esp
|
||||||
sub $4096,%eax
|
sub $4096,%eax
|
||||||
test %eax,(%esp)
|
|
||||||
jmp p4
|
jmp p4
|
||||||
|
|
||||||
p5:
|
p5:
|
||||||
|
|||||||
@ -13,10 +13,10 @@ alloca:
|
|||||||
#ifdef TCC_TARGET_PE
|
#ifdef TCC_TARGET_PE
|
||||||
p1:
|
p1:
|
||||||
cmp $4096,%eax
|
cmp $4096,%eax
|
||||||
jle p2
|
jb p2
|
||||||
|
test %eax,-4096(%esp)
|
||||||
sub $4096,%esp
|
sub $4096,%esp
|
||||||
sub $4096,%eax
|
sub $4096,%eax
|
||||||
test %eax,(%esp)
|
|
||||||
jmp p1
|
jmp p1
|
||||||
p2:
|
p2:
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -17,10 +17,10 @@ alloca:
|
|||||||
#ifdef TCC_TARGET_PE
|
#ifdef TCC_TARGET_PE
|
||||||
p1:
|
p1:
|
||||||
cmp $4096,%rax
|
cmp $4096,%rax
|
||||||
jle p2
|
jb p2
|
||||||
|
test %rax,-4096(%rsp)
|
||||||
sub $4096,%rsp
|
sub $4096,%rsp
|
||||||
sub $4096,%rax
|
sub $4096,%rax
|
||||||
test %rax,(%rsp)
|
|
||||||
jmp p1
|
jmp p1
|
||||||
p2:
|
p2:
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user