mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 19:09:32 +02:00
* only free the temp holding the function result after we've loaded it into
the function return register (so we won't load from an already freed temp once we emit lifetime info for temps on LLVM) git-svn-id: trunk@40501 -
This commit is contained in:
parent
14f3676b2a
commit
3b7efb5123
compiler
@ -5216,7 +5216,9 @@ implementation
|
||||
gen_load_loc_function_result(list,retdef,ressym.localloc);
|
||||
end
|
||||
else
|
||||
gen_load_uninitialized_function_result(list,current_procinfo.procdef,retdef,current_procinfo.procdef.funcretloc[calleeside])
|
||||
gen_load_uninitialized_function_result(list,current_procinfo.procdef,retdef,current_procinfo.procdef.funcretloc[calleeside]);
|
||||
if ressym.localloc.loc=LOC_REFERENCE then
|
||||
tg.UnGetLocal(list,ressym.localloc.reference);
|
||||
end;
|
||||
|
||||
procedure thlcgobj.gen_stack_check_size_para(list: TAsmList);
|
||||
|
@ -1816,7 +1816,11 @@ implementation
|
||||
cg.a_reg_sync(list,localloc.register);
|
||||
LOC_REFERENCE :
|
||||
begin
|
||||
if typ in [localvarsym,paravarsym] then
|
||||
{ can't free the result, because we load it after
|
||||
this call into the function result location
|
||||
(gets freed in thlcgobj.gen_load_return_value() }
|
||||
if (typ in [localvarsym,paravarsym]) and
|
||||
(([vo_is_funcret,vo_is_result]*varoptions)=[]) then
|
||||
tg.Ungetlocal(list,localloc.reference);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user