瀏覽代碼

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

git-svn-id: trunk@36506 -
pierre 8 年之前
父節點
當前提交
8b6563bef2
共有 1 個文件被更改,包括 4 次插入0 次删除
  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