From: Eric Botcazou Date: Fri, 6 May 2022 14:56:41 +0000 (+0200) Subject: [Ada] Add a comment about a finalization issue X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8182602c5061ddc9c329ecef26a7fd77b9264ec0;p=platform%2Fupstream%2Fgcc.git [Ada] Add a comment about a finalization issue gcc/ada/ * sem_ch5.adb (Analyze_Loop_Statement): Add a comment about a finalization issue. --- diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 66315ad..f430139 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -4056,6 +4056,12 @@ package body Sem_Ch5 is -- range requires the secondary stack. In this case the loop is -- wrapped within a block in order to manage the secondary stack. + -- ??? This overlooks finalization: the loop may leave the secondary + -- stack untouched, but its iterator or discrete range may need + -- finalization, in which case the block is also required. Therefore + -- the criterion must be based on Sem_Util.Requires_Transient_Scope, + -- which happens to be what is currently implemented. + if Present (Iter) then declare Stop_Processing : Boolean;