From: Ronan Desplanques Date: Mon, 2 Jun 2025 10:09:59 +0000 (+0200) Subject: ada: Fix assertion failure on finalizable aggregate X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef439d213b712b664c3f25fea34c876fa3cb5848;p=thirdparty%2Fgcc.git ada: Fix assertion failure on finalizable aggregate 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. --- diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 4d2b8348048..381294b05d6 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -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