Преглед на файлове

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