aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-08-17 01:18:43 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-08-29 15:06:28 +0200
commitcdd5dd2125ca850aa8599f76bed02509590541ef (patch)
treef0e2eca517c98fc4c0b66b774cee204040effa4b /gcc
parentd506247921d11b8013e99f5729385a9dd300b575 (diff)
downloadgcc-cdd5dd2125ca850aa8599f76bed02509590541ef.zip
gcc-cdd5dd2125ca850aa8599f76bed02509590541ef.tar.gz
gcc-cdd5dd2125ca850aa8599f76bed02509590541ef.tar.bz2
ada: Fix assertion failure on private limited with clause
This checks that the name is of an entity before accessing its Entity field. gcc/ada/ * sem_ch8.adb (Has_Private_With): Add test on Is_Entity_Name.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch8.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 9906006..13c44c5 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -8980,6 +8980,7 @@ package body Sem_Ch8 is
while Present (Item) loop
if Nkind (Item) = N_With_Clause
and then Private_Present (Item)
+ and then Is_Entity_Name (Name (Item))
and then Entity (Name (Item)) = E
then
return True;