]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix missing call to Finalize_Protection for simple protected objects
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 18 Sep 2023 07:14:46 +0000 (09:14 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 26 Sep 2023 11:43:18 +0000 (13:43 +0200)
commit6e8a0350a15c107d0079a0d953cea9f11d776aed
tree28ddb1c51cf180cd91fb186541a8ce66f7710d40
parentf6367fc211e52b3f7f8d0f2c481e20cb69839071
ada: Fix missing call to Finalize_Protection for simple protected objects

There is a glitch in Exp_Ch7.Build_Finalizer causing the finalizer to do
nothing for simple protected objects.

The change also removes redundant calls to the Is_Simple_Protected_Type
predicate and fixes a minor inconsistency between Requires_Cleanup_Actions
and Build_Finalizer for this case.

gcc/ada/

* exp_ch7.adb (Build_Finalizer.Process_Declarations): Remove call
to Is_Simple_Protected_Type as redundant.
(Build_Finalizer.Process_Object_Declaration): Do not retrieve the
corresponding record type for simple protected objects. Make the
flow of control more explicit in their specific processing.
* exp_util.adb (Requires_Cleanup_Actions): Return false for simple
protected objects present in library-level package bodies for the
sake of consistency with Build_Finalizer and remove call to
Is_Simple_Protected_Type as redundant.
gcc/ada/exp_ch7.adb
gcc/ada/exp_util.adb