浏览代码

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

git-svn-id: trunk@27814 -

nickysn 11 年之前
父节点
当前提交
cb05907e18
共有 1 个文件被更改,包括 6 次插入1 次删除
  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
                   debugging }
                 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);
               end;
           end;