* in constructors, free the temp holding self only after loading the function

result, as self is the function result there (follow up to 40501)

git-svn-id: trunk@40635 -
This commit is contained in:
Jonas Maebe 2018-12-24 22:10:09 +00:00
parent acf02ab64b
commit c9a7afe053

View File

@ -1818,9 +1818,11 @@ implementation
begin
{ 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() }
(gets freed in thlcgobj.gen_load_return_value();) }
if (typ in [localvarsym,paravarsym]) and
(([vo_is_funcret,vo_is_result]*varoptions)=[]) then
(([vo_is_funcret,vo_is_result]*varoptions)=[]) and
((current_procinfo.procdef.proctypeoption<>potype_constructor) or
not(vo_is_self in varoptions)) then
tg.Ungetlocal(list,localloc.reference);
end;
end;