]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix SPARK context not restored when Load_Unit is failing
authorMarc Poulhiès <poulhies@adacore.com>
Tue, 28 Feb 2023 10:01:47 +0000 (11:01 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 25 May 2023 07:44:15 +0000 (09:44 +0200)
commitf6156f454f2d88166cdc18e4281e084c31066f8f
treeccab0eaf4702af641f3a52d21db89129d0ecaaff
parent7b67bfab289d7f50beed51ca72717be5a8154f3b
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/rtsfind.adb
gcc/ada/sem_ch6.adb