diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2016-11-27 21:54:50 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2016-11-27 21:54:50 +0000 |
commit | 83740ae248bef9731ecf0e66e72c5fcf63445edf (patch) | |
tree | 5f21af655d64004fc74079833396250ecb385ddc /compiler/ncgld.pas | |
parent | f943f29bdc32fbee9736e2e5cccbd815e71f44dd (diff) | |
download | fpc-83740ae248bef9731ecf0e66e72c5fcf63445edf.tar.gz |
* 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: http://svn.freepascal.org/svn/fpc/trunk@35005 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ncgld.pas')
-rw-r--r-- | compiler/ncgld.pas | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/ncgld.pas b/compiler/ncgld.pas index 8638e5cfaf..d030aa7326 100644 --- a/compiler/ncgld.pas +++ b/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); |