mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 12:39:24 +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);
|
||||
begin
|
||||
// if assigned(Owner) then
|
||||
// Owner.DefList.List[i]:=nil;
|
||||
if assigned(Owner) and owner.deflist.OwnsObjects then
|
||||
Owner.DefList.extract(self);
|
||||
Owner:=st;
|
||||
Owner.DefList.Add(self);
|
||||
end;
|
||||
@ -680,6 +680,8 @@ implementation
|
||||
|
||||
procedure tsym.ChangeOwner(st:TSymtable);
|
||||
begin
|
||||
if assigned(owner) and owner.SymList.OwnsObjects then
|
||||
owner.symlist.extract(self);
|
||||
Owner:=st;
|
||||
inherited ChangeOwner(Owner.SymList);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user