Browse Source

* only create a new procsym for a specialization if it's indeed needed

git-svn-id: trunk@35013 -
svenbarth 8 years ago
parent
commit
0a1e080089
1 changed files with 4 additions and 1 deletions
  1. 4 1
      compiler/pgenutil.pas

+ 4 - 1
compiler/pgenutil.pas

@@ -938,7 +938,10 @@ uses
                 { First a new sym so we can reuse this specialization and
                   references to this specialization can be handled }
                 if genericdef.typ=procdef then
-                  srsym:=cprocsym.create(finalspecializename)
+                  if assigned(psym) then
+                    srsym:=psym
+                  else
+                    srsym:=cprocsym.create(finalspecializename)
                 else
                   srsym:=ctypesym.create(finalspecializename,generrordef,true);
                 { insert the symbol only if we don't know already that we have