From 36332b84ce1ce738883fad68f0de4f9e678ee5f8 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 14 Apr 2025 10:23:52 +0200 Subject: [PATCH] ada: Fix internal error on Ghost aspect applied to Big_Integers That's a regression introduced by the rewrite of the finalization machinery, in the form of dangling references to Master_Node entities remaining in the tree after the removal of the ignored Ghost code. gcc/ada/ChangeLog: * exp_ch7.adb (Process_Transient_In_Scope): Bail out if the object is an ignored ghost entity. --- gcc/ada/exp_ch7.adb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 905094c7e40..1c569b90dd2 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -5275,6 +5275,13 @@ package body Exp_Ch7 is Obj_Typ : Entity_Id; begin + -- Ignored Ghost objects do not need any cleanup actions because + -- they will not appear in the final tree. + + if Is_Ignored_Ghost_Entity (Obj_Id) then + return; + end if; + -- If the object needs to be exported to the outer finalizer, -- create the declaration of the Master_Node for the object, -- which will later be picked up by Build_Finalizer. -- 2.47.2