* check whether the stack size specified in the $M directive exceeds the maximum

stack size
* allow setting a stack size of _exactly_ 1024 bytes with the $M directive

git-svn-id: trunk@27963 -
This commit is contained in:
nickysn 2014-06-15 09:55:13 +00:00
parent 421139e77a
commit c868a5e0ea

View File

@ -706,8 +706,15 @@ unit scandir;
begin
current_scanner.skipspace;
l:=current_scanner.readval;
if l>1024 then
stacksize:=l;
if (l>=1024)
{$ifdef cpu16bitaddr}
and (l<=65521) { TP7's $M directive allows specifying a stack size of
65521, but it actually sets the stack size to 65520 }
{$else cpu16bitaddr}
and (l<67107840)
{$endif cpu16bitaddr}
then
stacksize:=min(l,{$ifdef cpu16bitaddr}65520{$else}67107839{$endif});
if c=',' then
begin
current_scanner.readchar;