diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-08-17 01:18:43 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-08-29 15:06:28 +0200 |
commit | cdd5dd2125ca850aa8599f76bed02509590541ef (patch) | |
tree | f0e2eca517c98fc4c0b66b774cee204040effa4b /gcc | |
parent | d506247921d11b8013e99f5729385a9dd300b575 (diff) | |
download | gcc-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.adb | 1 |
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; |