public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-391] [Ada] Fix compiler crash on FOR iteration scheme over container
@ 2022-05-13  8:07 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-13  8:07 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0145570e89270c33d4cf2a0abd2a215f09456789

commit r13-391-g0145570e89270c33d4cf2a0abd2a215f09456789
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu Feb 17 18:20:01 2022 +0100

    [Ada] Fix compiler crash on FOR iteration scheme over container
    
    The front-end drops a freeze node on the floor because it puts the node
    into the Condition_Actions of an N_Iteration_Scheme of a FOR loop.
    
    gcc/ada/
    
            * exp_util.adb (Insert_Actions) <N_Iteration_Scheme>: Check that
            it is a WHILE iteration scheme before using Condition_Actions.

Diff:
---
 gcc/ada/exp_util.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index e590751a15f..cd497ee453b 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -7545,7 +7545,7 @@ package body Exp_Util is
             when N_Elsif_Part
                | N_Iteration_Scheme
             =>
-               if N = Condition (P) then
+               if Present (Condition (P)) and then N = Condition (P) then
                   if Present (Condition_Actions (P)) then
                      Insert_List_After_And_Analyze
                        (Last (Condition_Actions (P)), Ins_Actions);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-13  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13  8:07 [gcc r13-391] [Ada] Fix compiler crash on FOR iteration scheme over container 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).