From b7d461d0f03362bc58126fce0a9372412de90ad7 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 8 Jan 2009 18:05:11 +0000 Subject: [PATCH] * fixed generic stack checking code (the stack pointer is already decreased before FPC_STACKCHECK is called, so don't subtract the allocated size again when checking) git-svn-id: trunk@12525 - --- rtl/inc/system.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rtl/inc/system.inc b/rtl/inc/system.inc index ca181e8437..8ef6acaed2 100644 --- a/rtl/inc/system.inc +++ b/rtl/inc/system.inc @@ -708,7 +708,10 @@ begin { Avoid recursive calls when called from the exit routines } if StackError then exit; - c := Sptr - (stack_size + STACK_MARGIN); + { don't use sack_size, since the stack pointer has already been + decreased when this routine is called + } + c := Sptr - STACK_MARGIN; if (c <= StackBottom) then begin StackError:=true;