From 5b7745e4201bf5de3f11c4041e81c6327ca27683 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 16 Mar 1999 21:07:25 +0000 Subject: [PATCH] * check for dup uses --- compiler/pmodules.pas | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas index d6b13a9c72..78b6491969 100644 --- a/compiler/pmodules.pas +++ b/compiler/pmodules.pas @@ -550,6 +550,7 @@ unit pmodules; procedure loadunits; var s : stringid; + pu, hp : pused_unit; hp2 : pmodule; hp3 : psymtable; @@ -563,8 +564,16 @@ unit pmodules; repeat s:=pattern; consume(ID); + { check if the unit is already used } + pu:=pused_unit(current_module^.used_units.first); + while assigned(pu) do + begin + if (pu^.name^=s) then + break; + pu:=pused_unit(pu^.next); + end; { avoid uses of itself } - if s<>current_module^.modulename^ then + if not assigned(pu) and (s<>current_module^.modulename^) then begin { load the unit } hp2:=loadunit(s,false); @@ -1247,7 +1256,10 @@ unit pmodules; end. { $Log$ - Revision 1.101 1999-02-25 21:02:43 peter + Revision 1.102 1999-03-16 21:07:25 peter + * check for dup uses + + Revision 1.101 1999/02/25 21:02:43 peter * ag386bin updates + coff writer