Browse Source

* since we only build the deref for tprocdef.localst when we're
going to write it to the ppu since r26083, also only deref it
if that's the case (mantis #25814)

git-svn-id: trunk@26956 -

Jonas Maebe 11 years ago
parent
commit
ffac2feb59
4 changed files with 46 additions and 7 deletions
  1. 2 0
      .gitattributes
  2. 7 7
      compiler/symdef.pas
  3. 25 0
      tests/webtbs/tw25814.pp
  4. 12 0
      tests/webtbs/uw25814.pp

+ 2 - 0
.gitattributes

@@ -13835,6 +13835,7 @@ tests/webtbs/tw25598.pp svneol=native#text/plain
 tests/webtbs/tw25603.pp svneol=native#text/pascal
 tests/webtbs/tw2561.pp svneol=native#text/plain
 tests/webtbs/tw25685.pp svneol=native#text/pascal
+tests/webtbs/tw25814.pp svneol=native#text/plain
 tests/webtbs/tw2588.pp svneol=native#text/plain
 tests/webtbs/tw2589.pp svneol=native#text/plain
 tests/webtbs/tw2594.pp svneol=native#text/plain
@@ -14611,6 +14612,7 @@ tests/webtbs/uw25059.test.pp svneol=native#text/pascal
 tests/webtbs/uw25059.withdot.pp svneol=native#text/pascal
 tests/webtbs/uw25132.pp svneol=native#text/pascal
 tests/webtbs/uw25598.pp svneol=native#text/plain
+tests/webtbs/uw25814.pp svneol=native#text/plain
 tests/webtbs/uw2706a.pp svneol=native#text/plain
 tests/webtbs/uw2706b.pp svneol=native#text/plain
 tests/webtbs/uw2731.pp svneol=native#text/plain

+ 7 - 7
compiler/symdef.pas

@@ -5215,16 +5215,16 @@ implementation
          if assigned(inlininginfo) then
            include(procoptions,po_has_inlininginfo);
 
-         { Locals }
-         if assigned(localst) then
-           begin
-             tlocalsymtable(localst).deref;
-             tlocalsymtable(localst).derefimpl;
-           end;
-
         { Inline }
         if (po_has_inlininginfo in procoptions) then
           begin
+            { Locals }
+            if assigned(localst) then
+              begin
+                tlocalsymtable(localst).deref;
+                tlocalsymtable(localst).derefimpl;
+              end;
+
             inlininginfo^.code.derefimpl;
             { funcretsym, this is always located in the localst }
             funcretsym:=tsym(funcretsymderef.resolve);

+ 25 - 0
tests/webtbs/tw25814.pp

@@ -0,0 +1,25 @@
+{ %norun }
+{ %recompile=-dchangeuses }
+
+unit tw25814;
+
+{$mode delphi}
+
+interface
+
+uses {$ifdef changeuses}sysutils,{$endif} classes, uw25814;
+
+type
+  test = class
+  function xyz(b: string): string;
+  end;
+
+implementation
+
+function test.xyz(b: string): string;
+begin
+ result:='';
+end;
+
+end.
+

+ 12 - 0
tests/webtbs/uw25814.pp

@@ -0,0 +1,12 @@
+unit uw25814;
+
+{$mode delphi}
+
+interface
+
+implementation
+
+uses tw25814;
+
+end.
+