* In genhightree, do typecheckpass later to prevent references to possibly

optimizes away nodes.

git-svn-id: trunk@6994 -
This commit is contained in:
daniel 2007-03-25 13:11:29 +00:00
parent edebd84426
commit d4de54402c

View File

@ -608,18 +608,23 @@ implementation
end;
{In the procedure the array range is 0..(upper_bound-lower_bound).}
hightree:=caddnode.create(subn,r,l);
typecheckpass(hightree);
{Replace the rangnode in the tree by its lower_bound, and
dispose the rangenode.}
temp:=Tvecnode(p).right;
Tvecnode(p).right:=l.getcopy;
{Typecheckpass can only be performed *after* the l.getcopy since it
can modify the tree, and l is in the hightree.}
typecheckpass(hightree);
with Trangenode(temp) do
begin
left:=nil;
right:=nil;
end;
temp.free;
{Tree changed from p[l..h] to p[l], recalculate resultdef.}
p.resultdef:=nil;
typecheckpass(p);