[multiple changes]
[gcc.git] / gcc / ada / ali.adb
index 06055bad6a6234143656114e7e1a3a534e4244a6..28d02cc79ec05555e2b0266a677c6b50abd4eeaa 100644 (file)
@@ -282,6 +282,7 @@ package body ALI is
          loop
             if C = CR or else C = LF then
                Skip_Line;
+               C := Nextc;
 
             elsif C = EOF then
                return;
@@ -601,6 +602,8 @@ package body ALI is
    --  Start of processing for Scan_ALI
 
    begin
+      First_Sdep_Entry := Sdep.Last + 1;
+
       --  Acquire lines to be ignored
 
       if Read_Xref then
@@ -786,6 +789,7 @@ package body ALI is
                Fatal_Error;
             else
                Skip_Line;
+               C := Nextc;
             end if;
          else
             Fatal_Error;
@@ -946,6 +950,7 @@ package body ALI is
                Fatal_Error;
             else
                Skip_Line;
+               C := Nextc;
             end if;
          else
             Fatal_Error;
@@ -1809,6 +1814,8 @@ package body ALI is
                   ----------------------------------
 
                   procedure Read_Instantiation_Reference is
+                     Local_File_Num : Sdep_Id := Current_File_Num;
+
                   begin
                      Xref.Increment_Last;
 
@@ -1822,12 +1829,12 @@ package body ALI is
                         if Nextc = '|' then
                            XR.File_Num :=
                              Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
-                           Current_File_Num := XR.File_Num;
+                           Local_File_Num := XR.File_Num;
                            P := P + 1;
                            N := Get_Nat;
 
                         else
-                           XR.File_Num := Current_File_Num;
+                           XR.File_Num := Local_File_Num;
                         end if;
 
                         XR.Line  := N;