diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2012-07-23 13:49:29 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2012-07-23 13:49:29 +0000 |
commit | e934bcd3a21fdd546051c176077014d17a9d0b71 (patch) | |
tree | 74401984b0c17dc0c07865b532d028fd85f6bece /compiler/parabase.pas | |
parent | 9960ad2d43cf2d3665e709f506ff1383c4785e87 (diff) | |
download | fpc-e934bcd3a21fdd546051c176077014d17a9d0b71.tar.gz |
* 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
Diffstat (limited to 'compiler/parabase.pas')
-rw-r--r-- | compiler/parabase.pas | 13 |
1 files changed, 11 insertions, 2 deletions
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 |