From: Piotr Trojanek Date: Wed, 26 May 2021 13:05:28 +0000 (+0200) Subject: [Ada] Prevent infinite recursion when there is no expected unit X-Git-Tag: basepoints/gcc-13~6160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62aae315f680f2205d474ff3ebcb1756a707f715;p=thirdparty%2Fgcc.git [Ada] Prevent infinite recursion when there is no expected unit gcc/ada/ * par-load.adb (Load): Don't remove unit, but flag it as erroneous and return. --- diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb index 0773f36946fd..6079fa477f6b 100644 --- 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