Browse Source

* only call add_synthetic_method_implementations() for the localst after
parsing a routine if the localst is in fact a localsymtable, otherwise
they can be generated twice for for the staticsymtable (the localst
of the init/final code of a unit is the staticsymtable)

git-svn-id: branches/jvmbackend@18476 -

Jonas Maebe 14 years ago
parent
commit
23539dcfaf
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compiler/psub.pas

+ 4 - 2
compiler/psub.pas

@@ -1957,8 +1957,10 @@ implementation
          until false;
 
          { add implementations for synthetic method declarations added by
-           the compiler }
-         add_synthetic_method_implementations(current_procinfo.procdef.localst);
+           the compiler (not for unit/program init functions, their localst
+           is the staticst -> would duplicate the work done in pmodules) }
+         if current_procinfo.procdef.localst.symtabletype=localsymtable then
+           add_synthetic_method_implementations(current_procinfo.procdef.localst);
 
          { check for incomplete class definitions, this is only required
            for fpc modes }