From 3289f1a374481d85c01f2db30201ea815624e612 Mon Sep 17 00:00:00 2001 From: Denis Mazzucato Date: Wed, 9 Jul 2025 12:03:53 +0200 Subject: [PATCH] ada: Fix crash when creating extra formals for aliased types This patch makes sure that we return the same decision for all aliased types when checking if the BIP task extra actuals are needed. gcc/ada/ChangeLog: * sem_ch6.adb (Might_Need_BIP_Task_Actuals): Before retrieving the original corresponding operation we retrieve first the root of the aliased chain. --- gcc/ada/sem_ch6.adb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index ce5b800e48c..709f6254b5e 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -8684,17 +8684,18 @@ package body Sem_Ch6 is then Subp_Id := Protected_Body_Subprogram (E); - -- For access to subprogram types we look at the return type of the + -- For access-to-subprogram types we look at the return type of the -- subprogram type itself, as it cannot be overridden or inherited. elsif Ekind (E) = E_Subprogram_Type then Subp_Id := E; -- Otherwise, we need to return the same value we would return for - -- the original corresponding operation. + -- the original corresponding operation of the root of the aliased + -- chain. else - Subp_Id := Original_Corresponding_Operation (E); + Subp_Id := Original_Corresponding_Operation (Ultimate_Alias (E)); end if; Original := Underlying_Type (Etype (Subp_Id)); -- 2.47.2