aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-05-26 15:05:28 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-08 13:34:19 +0000
commit62aae315f680f2205d474ff3ebcb1756a707f715 (patch)
tree02e50be9ce957e8d58b1709e43e9ee1ad100a6ae /gcc
parent6105ebb782756b449ee2ebec01bd4dd2c256ff17 (diff)
downloadgcc-62aae315f680f2205d474ff3ebcb1756a707f715.zip
gcc-62aae315f680f2205d474ff3ebcb1756a707f715.tar.gz
gcc-62aae315f680f2205d474ff3ebcb1756a707f715.tar.bz2
[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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/par-load.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb
index 0773f36..6079fa4 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