浏览代码

* i8086 far data memory model fix for except_buf_size

git-svn-id: trunk@27371 -
nickysn 11 年之前
父节点
当前提交
66d7beb7fe
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      compiler/ncgutil.pas

+ 7 - 3
compiler/ncgutil.pas

@@ -382,11 +382,15 @@ implementation
 *****************************************************************************}
 
     procedure get_exception_temps(list:TAsmList;var t:texceptiontemps);
-     const
-       EXCEPT_BUF_SIZE = 3*sizeof(pint);
+     var
+       except_buf_size: longint;
      begin
+        { todo: is there a way to retrieve the except_buf_size from the size of
+          the TExceptAddr record from the system unit (like we do for jmp_buf_size),
+          without moving TExceptAddr to the interface part? }
+        except_buf_size:=voidpointertype.size*2+sizeof(pint);
         get_jumpbuf_size;
-        tg.GetTemp(list,EXCEPT_BUF_SIZE,sizeof(pint),tt_persistent,t.envbuf);
+        tg.GetTemp(list,except_buf_size,sizeof(pint),tt_persistent,t.envbuf);
         tg.GetTemp(list,jmp_buf_size,jmp_buf_align,tt_persistent,t.jmpbuf);
         tg.GetTemp(list,sizeof(pint),sizeof(pint),tt_persistent,t.reasonbuf);
       end;