From: Ronan Desplanques <desplanq...@adacore.com>

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.

Tested on x86_64-pc-linux-gnu, committed on master.

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

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
-- 
2.43.0

Reply via email to