mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 01:39:26 +02:00
* extract a symbol or def from its previous owner if that owner has OwnsObjects set to true
This commit is contained in:
parent
088c746d45
commit
a7a0f47d98
@ -510,8 +510,8 @@ implementation
|
|||||||
|
|
||||||
procedure tdef.ChangeOwner(st:TSymtable);
|
procedure tdef.ChangeOwner(st:TSymtable);
|
||||||
begin
|
begin
|
||||||
// if assigned(Owner) then
|
if assigned(Owner) and owner.deflist.OwnsObjects then
|
||||||
// Owner.DefList.List[i]:=nil;
|
Owner.DefList.extract(self);
|
||||||
Owner:=st;
|
Owner:=st;
|
||||||
Owner.DefList.Add(self);
|
Owner.DefList.Add(self);
|
||||||
end;
|
end;
|
||||||
@ -680,6 +680,8 @@ implementation
|
|||||||
|
|
||||||
procedure tsym.ChangeOwner(st:TSymtable);
|
procedure tsym.ChangeOwner(st:TSymtable);
|
||||||
begin
|
begin
|
||||||
|
if assigned(owner) and owner.SymList.OwnsObjects then
|
||||||
|
owner.symlist.extract(self);
|
||||||
Owner:=st;
|
Owner:=st;
|
||||||
inherited ChangeOwner(Owner.SymList);
|
inherited ChangeOwner(Owner.SymList);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user