]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix internal error on Ghost aspect applied to Big_Integers
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 14 Apr 2025 08:23:52 +0000 (10:23 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 30 Jun 2025 17:12:55 +0000 (19:12 +0200)
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

index 905094c7e404099f3f992273fb777270676e75f0..1c569b90dd2a2470503d35e8f9a82cf9cf93edc9 100644 (file)
@@ -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.