Browse Source

* don't mangle local variable and parameter names using the method name,
since those names are only used for debug info. Only the names of
staticvarsyms in local symtables (typed constants, variable initialisers)
have to be mangled like that since they'll become fields in the global
scope

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

Jonas Maebe 14 years ago
parent
commit
4cd9908339
1 changed files with 13 additions and 10 deletions
  1. 13 10
      compiler/jvmdef.pas

+ 13 - 10
compiler/jvmdef.pas

@@ -518,19 +518,22 @@ implementation
                 result:='result '+result
               else
                 begin
+                  result:=usesymname+' '+result;
                   { we have to mangle staticvarsyms in localsymtables to
                     prevent name clashes... }
-                  container:=sym.Owner;
-                  result:=usesymname+' '+result;
-                  while (container.symtabletype=localsymtable) do
+                  if (vsym.typ=staticvarsym) then
                     begin
-                      if tdef(container.defowner).typ<>procdef then
-                        internalerror(2011040303);
-                      { not safe yet in case of overloaded routines, need to
-                        encode parameters too or find another way for conflict
-                        resolution }
-                      result:=tprocdef(container.defowner).procsym.realname+'$'+result;
-                      container:=container.defowner.owner;
+                      container:=sym.Owner;
+                      while (container.symtabletype=localsymtable) do
+                        begin
+                          if tdef(container.defowner).typ<>procdef then
+                            internalerror(2011040303);
+                          { not safe yet in case of overloaded routines, need to
+                            encode parameters too or find another way for conflict
+                            resolution }
+                          result:=tprocdef(container.defowner).procsym.realname+'$'+result;
+                          container:=container.defowner.owner;
+                        end;
                     end;
                 end;
             end;