From f6156f454f2d88166cdc18e4281e084c31066f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Tue, 28 Feb 2023 11:01:47 +0100 Subject: 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. --- gcc/ada/sem_ch6.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/ada/sem_ch6.adb') 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 -- cgit v1.1