Browse Source

* fixed the global function to nested procvar conversion in the i8086 far data
memory models

git-svn-id: trunk@27814 -

nickysn 11 years ago
parent
commit
cb05907e18
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/ncgcnv.pas

+ 6 - 1
compiler/ncgcnv.pas

@@ -574,7 +574,12 @@ interface
                   since the global procedure won't use it, but it can help with
                   since the global procedure won't use it, but it can help with
                   debugging }
                   debugging }
                 inc(location.reference.offset,voidcodepointertype.size);
                 inc(location.reference.offset,voidcodepointertype.size);
-                hlcg.a_load_const_ref(current_asmdata.CurrAsmList,voidpointertype,0,location.reference);
+                if (resultdef.typ=procvardef) and is_nested_pd(tprocvardef(resultdef)) then
+                  hlcg.a_load_const_ref(current_asmdata.CurrAsmList,parentfpvoidpointertype,0,location.reference)
+                else if tabstractprocdef(resultdef).is_methodpointer then
+                  hlcg.a_load_const_ref(current_asmdata.CurrAsmList,voidpointertype,0,location.reference)
+                else
+                  internalerror(2014052301);
                 dec(location.reference.offset,voidcodepointertype.size);
                 dec(location.reference.offset,voidcodepointertype.size);
               end;
               end;
           end;
           end;