diff --git a/.gitattributes b/.gitattributes index 62fc84da40..ea917226ab 100644 --- a/.gitattributes +++ b/.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 diff --git a/compiler/ncal.pas b/compiler/ncal.pas index c1efca2a37..4bf6208858 100644 --- a/compiler/ncal.pas +++ b/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; diff --git a/tests/webtbs/tw38316.pp b/tests/webtbs/tw38316.pp new file mode 100644 index 0000000000..29cd58b0e7 --- /dev/null +++ b/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.