* increase refs of hidden high parameter if the corresponding open/const array is used

git-svn-id: trunk@27331 -
This commit is contained in:
florian 2014-03-29 13:10:54 +00:00
parent 601d210763
commit a4b6e99db1

View File

@ -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