mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 20:19:25 +02:00
* let inline parameter temps inherit the "const" property of const
parameters, so we don't apply reference counting to them (mantis #30323) git-svn-id: trunk@34288 -
This commit is contained in:
parent
18580d3069
commit
70b1b32722
@ -4686,12 +4686,26 @@ implementation
|
||||
addstatement(inlinecleanupstatement,ctempdeletenode.create(tempnode));
|
||||
|
||||
addstatement(inlineinitstatement,cassignmentnode.create(ctemprefnode.create(tempnode),
|
||||
para.left));
|
||||
para.left));
|
||||
|
||||
para.left := ctemprefnode.create(tempnode);
|
||||
{ inherit addr_taken flag }
|
||||
if (tabstractvarsym(para.parasym).addr_taken) then
|
||||
include(tempnode.tempinfo^.flags,ti_addr_taken);
|
||||
|
||||
{ inherit const }
|
||||
if tabstractvarsym(para.parasym).varspez=vs_const then
|
||||
begin
|
||||
include(tempnode.tempinfo^.flags,ti_const);
|
||||
|
||||
{ apply less strict rules for the temp. to be a register than
|
||||
ttempcreatenode does
|
||||
|
||||
this way, dyn. array, ansistrings etc. can be put into registers as well }
|
||||
if tparavarsym(para.parasym).is_regvar(false) then
|
||||
include(tempnode.tempinfo^.flags,ti_may_be_in_reg);
|
||||
end;
|
||||
|
||||
result:=true;
|
||||
end
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user