From e934bcd3a21fdd546051c176077014d17a9d0b71 Mon Sep 17 00:00:00 2001 From: jonas Date: Mon, 23 Jul 2012 13:49:29 +0000 Subject: * fixed memory leaks in the compiler introduced in r21862 by marking and releasing temporarily created function result locations git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21953 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/parabase.pas | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'compiler/parabase.pas') diff --git a/compiler/parabase.pas b/compiler/parabase.pas index b829301e8d..0ec2e7fbd5 100644 --- a/compiler/parabase.pas +++ b/compiler/parabase.pas @@ -73,18 +73,20 @@ unit parabase; end; TCGPara = object + Def : tdef; { Type of the parameter } Location : PCGParalocation; IntSize : tcgint; { size of the total location in bytes } + DefDeref : tderef; Alignment : ShortInt; Size : TCGSize; { Size of the parameter included in all locations } - Def : tdef; { Type of the parameter } - DefDeref : tderef; + Temporary : boolean; { created on the fly, no permanent references exist to this somewhere that will cause it to be disposed } {$ifdef powerpc} composite: boolean; { under the AIX abi, how certain parameters are passed depends on whether they are composite or not } {$endif powerpc} constructor init; destructor done; procedure reset; + procedure resetiftemp; { reset if Temporary } function getcopy:tcgpara; procedure check_simple_location; function add_location:pcgparalocation; @@ -132,6 +134,7 @@ implementation intsize:=0; location:=nil; def:=nil; + temporary:=false; {$ifdef powerpc} composite:=false; {$endif powerpc} @@ -162,6 +165,12 @@ implementation {$endif powerpc} end; + procedure TCGPara.resetiftemp; + begin + if temporary then + reset; + end; + function tcgpara.getcopy:tcgpara; var -- cgit v1.2.1