mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 06:19:32 +02:00
* increase refs of hidden high parameter if the corresponding open/const array is used
git-svn-id: trunk@27331 -
This commit is contained in:
parent
601d210763
commit
a4b6e99db1
@ -1521,6 +1521,7 @@ implementation
|
||||
|
||||
var
|
||||
i : longint;
|
||||
highsym,
|
||||
sym : tsym;
|
||||
vs : tabstractnormalvarsym;
|
||||
isaddr : boolean;
|
||||
@ -1561,6 +1562,16 @@ implementation
|
||||
end
|
||||
else
|
||||
begin
|
||||
{ if an open array is used, also its high parameter is used,
|
||||
since the hidden high parameters are inserted after the corresponding symbols,
|
||||
we can increase the ref. count here }
|
||||
if is_open_array(vs.vardef) or is_array_of_const(vs.vardef) then
|
||||
begin
|
||||
highsym:=get_high_value_sym(tparavarsym(vs));
|
||||
if assigned(highsym) then
|
||||
inc(highsym.refs);
|
||||
end;
|
||||
|
||||
isaddr:=paramanager.push_addr_param(vs.varspez,vs.vardef,pd.proccalloption);
|
||||
if isaddr then
|
||||
vs.initialloc.size:=OS_ADDR
|
||||
|
Loading…
Reference in New Issue
Block a user