Destroy tfornode class loopiteration field if assigned

git-svn-id: trunk@49329 -
This commit is contained in:
pierre 2021-05-03 16:04:19 +00:00
parent 1e1848da92
commit 39896a1b11

View File

@ -111,6 +111,7 @@ interface
loopiteration : tnode;
loopvar_notid:cardinal;
constructor create(l,r,_t1,_t2 : tnode;back : boolean);virtual;reintroduce;
destructor destroy;override;
function pass_typecheck:tnode;override;
function pass_1 : tnode;override;
function makewhileloop : tnode;
@ -1774,6 +1775,13 @@ implementation
include(loopflags,lnf_testatbegin);
end;
destructor tfornode.destroy;
begin
if assigned(loopiteration) then
loopiteration.destroy;
inherited destroy;
end;
function tfornode.simplify(forinline : boolean) : tnode;
begin
result:=nil;