]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix assertion failure on finalizable aggregate
authorRonan Desplanques <desplanques@adacore.com>
Mon, 2 Jun 2025 10:09:59 +0000 (12:09 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 3 Jul 2025 08:16:21 +0000 (10:16 +0200)
The Finalizable aspect makes it possible that
Insert_Actions_In_Scope_Around is entered with an empty list of after
actions. This patch fixes a condition that was not quite right in this
case.

gcc/ada/ChangeLog:

* exp_ch7.adb (Insert_Actions_In_Scope_Around): Fix condition.

gcc/ada/exp_ch7.adb

index 4d2b8348048e2468aae9206dea7e96c0d72657ca..381294b05d61fef928ba4026cc80de0422a1d7e3 100644 (file)
@@ -5460,7 +5460,7 @@ package body Exp_Ch7 is
 
       --  Finalization calls are inserted after the target
 
-      if Present (Act_After) then
+      if Is_Non_Empty_List (Act_After) then
          Last_Obj := Last (Act_After);
          Insert_List_After (Target, Act_After);
       else