aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2019-12-12 10:03:30 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-12-12 10:03:30 +0000
commitca00cd02323d71e99cebf583c34b07e7fc56c716 (patch)
tree6e65da29eb654353a56b4d42a45a94e62a257c9d /gcc/ada
parentfbb076f4dab3541351e4b5ffd5a79099873adae0 (diff)
downloadgcc-ca00cd02323d71e99cebf583c34b07e7fc56c716.zip
gcc-ca00cd02323d71e99cebf583c34b07e7fc56c716.tar.gz
gcc-ca00cd02323d71e99cebf583c34b07e7fc56c716.tar.bz2
[Ada] Fix related to handling up-level references in protected entries
2019-12-12 Gary Dismukes <dismukes@adacore.com> 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
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/exp_ch9.adb5
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d14f7e3..386ae09 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-12 Gary Dismukes <dismukes@adacore.com>
+
+ * 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 <baird@adacore.com>
* 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 6e34de1..60080e6 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))));