Jelajahi Sumber

Generate error if stack size of a procedure/function is bigger than globally allocated stack size

git-svn-id: trunk@36506 -
pierre 8 tahun lalu
induk
melakukan
8b6563bef2
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      compiler/i8086/tgcpu.pas

+ 4 - 0
compiler/i8086/tgcpu.pas

@@ -43,6 +43,8 @@ unit tgcpu;
 implementation
 
 uses
+  globals,
+  verbose,
   cpubase;
 
 { ttgi8086 }
@@ -51,6 +53,8 @@ procedure ttgi8086.alloctemp(list: TAsmList; size: asizeint; alignment: shortint
   begin
     inherited;
     ref.segment:=NR_SS;
+    if abs(ref.offset) > globals.StackSize then
+      message(cg_e_localsize_too_big);
   end;
 
 begin