+2019-09-19 Bob Duff <duff@adacore.com>
+
+ * xref_lib.adb (Get_Symbol_Name): If we reach EOF in the first
+ loop without finding the symbol, return "???". Otherwise, it's
+ an infinite loop.
+ (Parse_EOL): Assert that we're not already at EOF. Remove
+ processing of LF/CR -- there are no operating systems that use
+ that.
+
2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Is_Legal_Copy): Also return false for an aliased
is
begin
loop
+ pragma Assert (Source (Ptr) /= EOF);
+
-- Skip to end of line
while Source (Ptr) /= ASCII.CR and then Source (Ptr) /= ASCII.LF
Ptr := Ptr + 1;
end if;
- -- Skip past CR/LF or LF/CR combination
+ -- Skip past CR/LF
- if (Source (Ptr) = ASCII.CR or else Source (Ptr) = ASCII.LF)
- and then Source (Ptr) /= Source (Ptr - 1)
- then
+ if Source (Ptr - 1) = ASCII.CR and then Source (Ptr) = ASCII.LF then
Ptr := Ptr + 1;
end if;
-- line and column in the dependent unit number Eun. For this we need
-- to parse the ali file again because the parent entity is not in
-- the declaration table if it did not match the search pattern.
+ -- If the symbol is not found, we return "???".
procedure Skip_To_Matching_Closing_Bracket;
-- When Ptr points to an opening square bracket, moves it to the
-- Look for the X lines corresponding to unit Eun
loop
+ if Ali (Ptr) = EOF then
+ return "???";
+ end if;
+
if Ali (Ptr) = 'X' then
Ptr := Ptr + 1;
Parse_Number (Ali, Ptr, E_Eun);
exit when Ali (Ptr) = EOF;
end loop;
- -- We were not able to find the symbol, this should not happen but
- -- since we don't want to stop here we return a string of three
- -- question marks as the symbol name.
-
return "???";
end Get_Symbol_Name;