From 5c2303a76b1a616d24f9e41679bf61f79020f4c4 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 10 Jan 2021 15:47:27 +0000 Subject: [PATCH] * add parameter cleanup nodes to the call cleanup block (mantis #38316) git-svn-id: trunk@48130 - --- .gitattributes | 1 + compiler/ncal.pas | 3 +++ tests/webtbs/tw38316.pp | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 tests/webtbs/tw38316.pp 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.