From 8257829623d484229c9785deedd05375c5732493 Mon Sep 17 00:00:00 2001 From: Carlos Montiers Date: Thu, 10 Jul 2014 00:37:20 -0400 Subject: 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. --- lib/alloca86_64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/alloca86_64.S') diff --git a/lib/alloca86_64.S b/lib/alloca86_64.S index dd46ce6..51acd42 100644 --- a/lib/alloca86_64.S +++ b/lib/alloca86_64.S @@ -17,10 +17,10 @@ alloca: #ifdef TCC_TARGET_PE p1: cmp $4096,%rax - jle p2 + jb p2 + test %rax,-4096(%rsp) sub $4096,%rsp sub $4096,%rax - test %rax,(%rsp) jmp p1 p2: #endif -- cgit v1.3.1