https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116945
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |WONTFIX
Status|UNCONFIRMED |RESOLVED
CC| |ebotcazou at gcc dot gnu.org
--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
It's a call to 'Valid, which is precisely designed for this case:
-- If we have called Increment_Last but have not yet
-- initialized the new last element of the table, then
-- that last element might be invalid. Saving and
-- restoring (especially restoring, it turns out) invalid
-- values can result in exceptions if predicate checking
-- is enabled, so replace invalid values with Empty.
if Indexed_Assoc.Gen_Id'Valid then
Result_Pair.Formal_Id := Indexed_Assoc.Gen_Id;
else
pragma Assert (Index = Result'Last);
Result_Pair.Formal_Id := Empty;
end if;
if Indexed_Assoc.Act_Id'Valid then
Result_Pair.Actual_Id := Indexed_Assoc.Act_Id;
else
pragma Assert (Index = Result'Last);
Result_Pair.Actual_Id := Empty;
end if;