public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1593] [Ada] Missing finalization on nested expression with action
@ 2021-06-17 14:34 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-06-17 14:34 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:5f900b589c83b789329a0e99ddbe627507703e5e
commit r12-1593-g5f900b589c83b789329a0e99ddbe627507703e5e
Author: Arnaud Charlet <charlet@adacore.com>
Date: Thu Mar 11 11:00:04 2021 -0500
[Ada] Missing finalization on nested expression with action
gcc/ada/
* exp_ch4.adb (Expand_N_Expression_With_Actions.Process_Action):
Do not abandon processing on a nested N_Expression_With_Actions
or N_Loop_Statement, otherwise we may miss some transient
declarations.
Diff:
---
gcc/ada/exp_ch4.adb | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 5b3a11677db..4436557b354 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -5780,15 +5780,14 @@ package body Exp_Ch4 is
-- Avoid processing temporary function results multiple times when
-- dealing with nested expression_with_actions.
+ -- Similarly, do not process temporary function results in loops.
+ -- This is done by Expand_N_Loop_Statement and Build_Finalizer.
+ -- Note that we used to wrongly return Abandon instead of Skip here:
+ -- this is wrong since it means that we were ignoring lots of
+ -- relevant subsequent statements.
- elsif Nkind (Act) = N_Expression_With_Actions then
- return Abandon;
-
- -- Do not process temporary function results in loops. This is done
- -- by Expand_N_Loop_Statement and Build_Finalizer.
-
- elsif Nkind (Act) = N_Loop_Statement then
- return Abandon;
+ elsif Nkind (Act) in N_Expression_With_Actions | N_Loop_Statement then
+ return Skip;
end if;
return OK;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-17 14:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 14:34 [gcc r12-1593] [Ada] Missing finalization on nested expression with action Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).