Browse Source

* 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 years ago
parent
commit
1c820e9c8e
1 changed files with 3 additions and 1 deletions
  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);