Message ID | 20210708135015.GA2465724@adacore.com |
---|---|
State | New |
Headers | show |
Series | [Ada] Prevent infinite recursion when there is no expected unit | expand |
diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb --- a/gcc/ada/par-load.adb +++ b/gcc/ada/par-load.adb @@ -234,9 +234,10 @@ begin Error_Msg ("\\found unit $!", Loc); end if; - -- In both cases, remove the unit so that it is out of the way later + -- In both cases, flag the fatal error and give up - Remove_Unit (Cur_Unum); + Set_Fatal_Error (Cur_Unum, Error_Detected); + return; end if; -- If current unit is a body, load its corresponding spec