Browse Source

* Fixed comparison.

git-svn-id: trunk@40186 -
yury 6 years ago
parent
commit
a077e0dd90
1 changed files with 1 additions and 1 deletions
  1. 1 1
      rtl/inc/system.inc

+ 1 - 1
rtl/inc/system.inc

@@ -734,7 +734,7 @@ End;
 function StackTop: pointer;
 function StackTop: pointer;
 begin
 begin
   { Avoid wrap to zero on 32-bit }
   { Avoid wrap to zero on 32-bit }
-  if ptruint(StackBottom)+ StackLength > high(ptruint) then
+  if ptruint(StackBottom) > high(ptruint) - StackLength then
     result:=pointer(ptruint(high(ptruint)))
     result:=pointer(ptruint(high(ptruint)))
   else
   else
     result:=StackBottom + StackLength;
     result:=StackBottom + StackLength;