decr refcnt for out paras

This commit is contained in:
peter 2005-04-25 09:41:28 +00:00
parent 58202bd7d5
commit 5db9200128

View File

@ -313,6 +313,7 @@ implementation
procedure tcgcallparanode.secondcallparan;
var
href : treference;
otlabel,
oflabel : tasmlabel;
begin
@ -329,6 +330,14 @@ implementation
objectlibrary.getlabel(falselabel);
secondpass(left);
{ release memory for refcnt out parameters }
if (parasym.varspez=vs_out) and
(left.resulttype.def.needs_inittable) then
begin
location_get_data_ref(exprasmlist,left.location,href,false);
cg.g_decrrefcount(exprasmlist,left.resulttype.def,href);
end;
{$ifdef PASS2INLINE}
if assigned(aktcallnode.inlinecode) then
paramanager.duplicateparaloc(exprasmlist,aktcallnode.procdefinition.proccalloption,parasym,tempcgpara)
@ -1245,7 +1254,10 @@ begin
end.
{
$Log$
Revision 1.203 2005-04-05 21:06:44 peter
Revision 1.204 2005-04-25 09:41:28 peter
decr refcnt for out paras
Revision 1.203 2005/04/05 21:06:44 peter
* support typecasting a ordinal const to 8 byte record. a_param_loc
can't be used. Instead force the location to memory so it uses
a_param_ref