diff options
author | Marc Poulhiès <poulhies@adacore.com> | 2023-02-28 11:01:47 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-25 09:44:15 +0200 |
commit | f6156f454f2d88166cdc18e4281e084c31066f8f (patch) | |
tree | ccab0eaf4702af641f3a52d21db89129d0ecaaff /gcc/ada/sem_ch6.adb | |
parent | 7b67bfab289d7f50beed51ca72717be5a8154f3b (diff) | |
download | gcc-f6156f454f2d88166cdc18e4281e084c31066f8f.zip gcc-f6156f454f2d88166cdc18e4281e084c31066f8f.tar.gz gcc-f6156f454f2d88166cdc18e4281e084c31066f8f.tar.bz2 |
ada: Fix SPARK context not restored when Load_Unit is failing
When Load_Unit fails to find the unit or encounters an error, the
Load_Fail procedure is called and an exception is raised, skipping the
restoration of the SPARK/Ghost context stored on procedure entry.
gcc/ada/
* rtsfind.adb (Load_RTU.Restore_SPARK_Context): New.
(Load_RTU): Use Restore_SPARK_Context on all exit paths.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Initialize local
variable to Empty.
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r-- | gcc/ada/sem_ch6.adb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 992688c..48b363e 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -2277,7 +2277,7 @@ package body Sem_Ch6 is Mask_Types : Elist_Id := No_Elist; Prot_Typ : Entity_Id := Empty; Spec_Decl : Node_Id := Empty; - Spec_Id : Entity_Id; + Spec_Id : Entity_Id := Empty; Last_Real_Spec_Entity : Entity_Id := Empty; -- When we analyze a separate spec, the entity chain ends up containing |