]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix expansion of protected subprogram bodies
authorRonan Desplanques <desplanques@adacore.com>
Thu, 25 Apr 2024 10:09:16 +0000 (12:09 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 13 Jun 2024 13:30:31 +0000 (15:30 +0200)
commit9fe127c9c6320dea32d6441e10b654a7e2ab004c
tree7bd812dd831d53b133d1d4712ff656f4021c0889
parent72ccc99d6fc22aaae4aaf74027329acafd70cbfc
ada: Fix expansion of protected subprogram bodies

System.Tasking.Protected_Objects.Lock can raise exceptions, but that
wasn't taken into account by the expansion of protected subprogram
bodies before this patch. More precisely, there were cases where
calls to System.Tasking.Initialization.Abort_Undefer were
incorrectly omitted. This patch fixes this.

gcc/ada/

* exp_ch7.adb (Build_Cleanup_Statements): Adapt to changes
made to Build_Protected_Subprogram_Call_Cleanup.
* exp_ch9.adb (Make_Unlock_Statement, Wrap_Unprotected_Call):
New functions.
(Build_Protected_Subprogram_Body): Fix resource management in
generated code.
(Build_Protected_Subprogram_Call_Cleanup): Make use of newly
introduced Make_Unlock_Statement.
gcc/ada/exp_ch7.adb
gcc/ada/exp_ch9.adb