Browse Source

* finalize managed data passed to untyped "out" parameters after r31328
(mantis #2863)

git-svn-id: trunk@31624 -

Jonas Maebe 10 years ago
parent
commit
6ffd8f0201
3 changed files with 22 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 0 1
      compiler/ncal.pas
  3. 21 0
      tests/webtbs/tw28632.pp

+ 1 - 0
.gitattributes

@@ -14735,6 +14735,7 @@ tests/webtbs/tw2853d.pp svneol=native#text/plain
 tests/webtbs/tw2853e.pp svneol=native#text/plain
 tests/webtbs/tw2853e.pp svneol=native#text/plain
 tests/webtbs/tw2859.pp svneol=native#text/plain
 tests/webtbs/tw2859.pp svneol=native#text/plain
 tests/webtbs/tw28593.pp svneol=native#text/plain
 tests/webtbs/tw28593.pp svneol=native#text/plain
+tests/webtbs/tw28632.pp -text svneol=native#text/plain
 tests/webtbs/tw2865.pp svneol=native#text/plain
 tests/webtbs/tw2865.pp svneol=native#text/plain
 tests/webtbs/tw28650.pp svneol=native#text/pascal
 tests/webtbs/tw28650.pp svneol=native#text/pascal
 tests/webtbs/tw2876.pp svneol=native#text/plain
 tests/webtbs/tw2876.pp svneol=native#text/plain

+ 0 - 1
compiler/ncal.pas

@@ -1001,7 +1001,6 @@ implementation
 
 
         if assigned(parasym) and
         if assigned(parasym) and
            (parasym.varspez in [vs_var,vs_out,vs_constref]) and
            (parasym.varspez in [vs_var,vs_out,vs_constref]) and
-           (parasym.vardef.typ<>formaldef) and
            { for record constructors }
            { for record constructors }
            (left.nodetype<>nothingn) then
            (left.nodetype<>nothingn) then
           handlemanagedbyrefpara(left.resultdef);
           handlemanagedbyrefpara(left.resultdef);

+ 21 - 0
tests/webtbs/tw28632.pp

@@ -0,0 +1,21 @@
+{ %opt=-gh }
+
+{$mode objfpc}{$H+}
+
+procedure clear(out x);
+begin
+  pointer(x):=nil;
+end;
+
+procedure test;
+var
+  ii1: iunknown;
+begin
+  ii1:=tinterfacedobject.create;
+  clear(ii1);
+end;
+
+begin
+  HaltOnNotReleased:=true;
+  test;
+end.