From: Ronan Desplanques Date: Mon, 27 Jan 2025 11:04:41 +0000 (+0100) Subject: ada: Fix crash on access to protected return X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=201fd7899da99767f88fbd75d61b20fdc0cc190d;p=thirdparty%2Fgcc.git ada: Fix crash on access to protected return The generation of the check mandated by Ada issue AI05-0073 was not done handled properly for protected types when used through subtypes. This patch fixes the issue. gcc/ada/ChangeLog: * exp_ch4.adb (Tagged_Membership): Fix for protected types. --- diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 8c724844eb3..eb9fb6bba56 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -15036,10 +15036,11 @@ package body Exp_Ch4 is -- Handle entities from the limited view - Orig_Right_Type : constant Entity_Id := Available_View (Etype (Right)); + Orig_Right_Type : constant Entity_Id := + Base_Type (Available_View (Etype (Right))); Full_R_Typ : Entity_Id; - Left_Type : Entity_Id := Available_View (Etype (Left)); + Left_Type : Entity_Id := Base_Type (Available_View (Etype (Left))); Right_Type : Entity_Id := Orig_Right_Type; Obj_Tag : Node_Id;