From ca00cd02323d71e99cebf583c34b07e7fc56c716 Mon Sep 17 00:00:00 2001 From: Gary Dismukes Date: Thu, 12 Dec 2019 10:03:30 +0000 Subject: [PATCH] [Ada] Fix related to handling up-level references in protected entries 2019-12-12 Gary Dismukes gcc/ada/ * exp_ch9.adb (Build_Protected_Entry): Set the Scope of the new block to be the entity of the procedure created for the entry. From-SVN: r279300 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/exp_ch9.adb | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d14f7e3709a..386ae097679 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-12-12 Gary Dismukes + + * exp_ch9.adb (Build_Protected_Entry): Set the Scope of the new + block to be the entity of the procedure created for the entry. + 2019-12-12 Steve Baird * sem_ch10.adb (Install_With_Clause): Check for the case of a diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 6e34de131ff..60080e60066 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -3724,10 +3724,13 @@ package body Exp_Ch9 is Handled_Statement_Sequence => Handled_Statement_Sequence (N))); -- Analyze now and reset scopes for declarations so that Scope fields - -- currently denoting the entry will now denote the block scope. + -- currently denoting the entry will now denote the block scope, and + -- the block's scope will be set to the new procedure entity. Analyze_Statements (Bod_Stmts); + Set_Scope (Entity (Identifier (First (Bod_Stmts))), Bod_Id); + Reset_Scopes_To (First (Bod_Stmts), Entity (Identifier (First (Bod_Stmts)))); -- 2.30.2