The patch fixes an issue in the compiler whereby calls to
GNAT.Calendar.Time_IO.Value where the actual for formal String Date with
indexing starting at any value besides one would result in a spurious runtime
exception.
gcc/ada/
* libgnat/g-catiio.adb (Value): Modify conditionals to use 'Last
instead of 'Length
begin
Advance_Digits (Num_Digits => 1);
- while Index <= Date'Length and then Symbol in '0' .. '9' loop
+ while Index <= Date'Last and then Symbol in '0' .. '9' loop
Advance;
end loop;
-- Check for trailing characters
- if Index /= Date'Length + 1 then
+ if Index /= Date'Last + 1 then
raise Wrong_Syntax;
end if;