Przeglądaj źródła

* 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 -

nickysn 11 lat temu
rodzic
commit
c868a5e0ea
1 zmienionych plików z 9 dodań i 2 usunięć
  1. 9 2
      compiler/scandir.pas

+ 9 - 2
compiler/scandir.pas

@@ -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;