* don't pre-finalize temp nodes that are passed by reference as hidden

function result parameter, because reference counted function results
    are not guaranteed to be initialized (we sometimes even pass the,
    non-finalized, left-hand side of an assignment as hidden function
    result parameter)

git-svn-id: trunk@21955 -
This commit is contained in:
Jonas Maebe 2012-07-23 14:22:36 +00:00
parent ba4b08261c
commit ccbcb36f98

View File

@ -405,8 +405,10 @@ interface
location_reset_ref(tempinfo^.location,LOC_REFERENCE,def_cgsize(tempinfo^.typedef),0);
tg.gethltemptyped(current_asmdata.CurrAsmList,tempinfo^.typedef,tempinfo^.temptype,tempinfo^.location.reference);
{ the temp could have been used previously either because the memory location was reused or
because we're in a loop }
hlcg.g_finalize(current_asmdata.CurrAsmList,tempinfo^.typedef,tempinfo^.location.reference);
because we're in a loop. In case it's used as a function result, that doesn't matter
because it will be finalized when assigned to. }
if not(nf_is_funcret in flags) then
hlcg.g_finalize(current_asmdata.CurrAsmList,tempinfo^.typedef,tempinfo^.location.reference);
end
else if (ti_may_be_in_reg in tempinfo^.flags) then
begin