浏览代码

* taddrnode: fixed getting the address of nested procs in tp mode in i8086 far
data memory models

git-svn-id: trunk@27816 -

nickysn 11 年之前
父节点
当前提交
02dff17ae0
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      compiler/nmem.pas

+ 7 - 2
compiler/nmem.pas

@@ -481,6 +481,7 @@ implementation
          hp : tnode;
          hsym : tfieldvarsym;
          isprocvar : boolean;
+         procpointertype: tdef;
       begin
         result:=nil;
         typecheckpass(left);
@@ -541,14 +542,18 @@ implementation
                     if isprocvar or
                        is_nested_pd(tabstractprocdef(left.resultdef)) then
                       begin
+                        if tabstractprocdef(left.resultdef).is_methodpointer then
+                          procpointertype:=methodpointertype
+                        else
+                          procpointertype:=nestedprocpointertype;
                         { find proc field in methodpointer record }
-                        hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.Find('proc'));
+                        hsym:=tfieldvarsym(trecorddef(procpointertype).symtable.Find('proc'));
                         if not assigned(hsym) then
                           internalerror(200412041);
                         { Load tmehodpointer(left).proc }
                         result:=csubscriptnode.create(
                                      hsym,
-                                     ctypeconvnode.create_internal(left,methodpointertype));
+                                     ctypeconvnode.create_internal(left,procpointertype));
                         left:=nil;
                       end
                     else