mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 12:39:09 +02:00
* skip program when checking loaded_units for a unit
This commit is contained in:
parent
fb16b1c012
commit
24f64c776f
@ -1035,32 +1035,38 @@ uses
|
|||||||
hp.do_reload:=false;
|
hp.do_reload:=false;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
{ the unit is already registered }
|
{ only check for units. The main program is also
|
||||||
{ and this means that the unit }
|
as a unit in the loaded_units list. We simply need
|
||||||
{ is already compiled }
|
to ignore this entry (PFV) }
|
||||||
{ else there is a cyclic unit use }
|
if hp.is_unit then
|
||||||
if assigned(hp.globalsymtable) then
|
|
||||||
st:=tglobalsymtable(hp.globalsymtable)
|
|
||||||
else
|
|
||||||
begin
|
begin
|
||||||
{ both units in interface ? }
|
{ the unit is already registered }
|
||||||
if (not current_module.in_implementation) and
|
{ and this means that the unit }
|
||||||
(not hp.in_implementation) then
|
{ is already compiled }
|
||||||
|
{ else there is a cyclic unit use }
|
||||||
|
if assigned(hp.globalsymtable) then
|
||||||
|
st:=tglobalsymtable(hp.globalsymtable)
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
{ check for a cycle }
|
{ both units in interface ? }
|
||||||
hp2:=current_module.loaded_from;
|
if (not current_module.in_implementation) and
|
||||||
while assigned(hp2) and (hp2<>hp) do
|
(not hp.in_implementation) then
|
||||||
begin
|
begin
|
||||||
if hp2.in_implementation then
|
{ check for a cycle }
|
||||||
hp2:=nil
|
hp2:=current_module.loaded_from;
|
||||||
else
|
while assigned(hp2) and (hp2<>hp) do
|
||||||
hp2:=hp2.loaded_from;
|
begin
|
||||||
|
if hp2.in_implementation then
|
||||||
|
hp2:=nil
|
||||||
|
else
|
||||||
|
hp2:=hp2.loaded_from;
|
||||||
|
end;
|
||||||
|
if assigned(hp2) then
|
||||||
|
Message2(unit_f_circular_unit_reference,current_module.modulename^,hp.modulename^);
|
||||||
end;
|
end;
|
||||||
if assigned(hp2) then
|
|
||||||
Message2(unit_f_circular_unit_reference,current_module.modulename^,hp.modulename^);
|
|
||||||
end;
|
end;
|
||||||
|
break;
|
||||||
end;
|
end;
|
||||||
break;
|
|
||||||
end
|
end
|
||||||
else if copy(hp.modulename^,1,8)=ups then
|
else if copy(hp.modulename^,1,8)=ups then
|
||||||
dummy:=hp;
|
dummy:=hp;
|
||||||
@ -1143,7 +1149,10 @@ uses
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.5 2001-05-19 13:22:47 peter
|
Revision 1.6 2001-05-19 21:08:59 peter
|
||||||
|
* skip program when checking loaded_units for a unit
|
||||||
|
|
||||||
|
Revision 1.5 2001/05/19 13:22:47 peter
|
||||||
* fixed crash with invalid ppu version detected
|
* fixed crash with invalid ppu version detected
|
||||||
|
|
||||||
Revision 1.4 2001/05/09 14:11:10 jonas
|
Revision 1.4 2001/05/09 14:11:10 jonas
|
||||||
|
Loading…
Reference in New Issue
Block a user