2
0
Эх сурвалжийг харах

* add parameter cleanup nodes to the call cleanup block (mantis #38316)

git-svn-id: trunk@48130 -
Jonas Maebe 4 жил өмнө
parent
commit
5c2303a76b

+ 1 - 0
.gitattributes

@@ -18637,6 +18637,7 @@ tests/webtbs/tw38309.pp svneol=native#text/pascal
 tests/webtbs/tw38310a.pp svneol=native#text/pascal
 tests/webtbs/tw38310b.pp svneol=native#text/pascal
 tests/webtbs/tw38310c.pp svneol=native#text/pascal
+tests/webtbs/tw38316.pp svneol=native#text/plain
 tests/webtbs/tw3833.pp svneol=native#text/plain
 tests/webtbs/tw38337.pp svneol=native#text/plain
 tests/webtbs/tw38339.pp svneol=native#text/plain

+ 3 - 0
compiler/ncal.pas

@@ -928,7 +928,10 @@ implementation
                   reused above) }
                 left:=ctemprefnode.create(paratemp);
               end;
+            { add the finish statements to the call cleanup block }
             addstatement(finistat,ctempdeletenode.create(paratemp));
+            aktcallnode.add_done_statement(finiblock);
+
             firstpass(fparainit);
             firstpass(left);
           end;

+ 21 - 0
tests/webtbs/tw38316.pp

@@ -0,0 +1,21 @@
+{ %opt=-gh }
+
+program project1;
+
+procedure P1(A: array of Integer);
+begin
+end;
+
+procedure P2(A: array of Integer);
+begin
+  P1(A);
+end;
+
+var
+  A: array [0..2] of Integer;
+  i: Integer;
+begin
+  HaltOnNotReleased := true;
+  for i := 0 to 10 do
+    P2(A);
+end.