瀏覽代碼

* similar change as in r34976 for the generic code: don't assume that if
a load node for a procsym has a self pointer, that we have to create
a procvar with a self pointer (e.g. when loading the address of a
static class method). Avoids the generation of superfluous code to
load self which is then not used afterwards

git-svn-id: trunk@35005 -

Jonas Maebe 8 年之前
父節點
當前提交
1c820e9c8e
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      compiler/ncgld.pas

+ 3 - 1
compiler/ncgld.pas

@@ -521,7 +521,9 @@ implementation
               begin
                  if not assigned(procdef) then
                    internalerror(200312011);
-                 if assigned(left) then
+                 if assigned(left) and
+                   (resultdef.typ in [symconst.procdef,procvardef]) and
+                    not tabstractprocdef(resultdef).is_addressonly then
                    begin
                      location_reset(location,LOC_CREGISTER,int_cgsize(voidpointertype.size*2));
                      secondpass(left);