aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2025-01-27 12:04:41 +0100
committerEric Botcazou <ebotcazou@adacore.com>2025-06-05 15:39:41 +0200
commit257a8dc92efbc5f523d388da10d63bf126af2aa3 (patch)
tree35fbdfd866051da06d013356295796a9284ea64f
parent6b1c8f47583c8fb35009b8dead605f623aeb5376 (diff)
downloadgcc-257a8dc92efbc5f523d388da10d63bf126af2aa3.zip
gcc-257a8dc92efbc5f523d388da10d63bf126af2aa3.tar.gz
gcc-257a8dc92efbc5f523d388da10d63bf126af2aa3.tar.bz2
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.
-rw-r--r--gcc/ada/exp_ch4.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 8c72484..eb9fb6b 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;