aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-03-29 16:21:01 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-05-29 10:23:19 +0200
commita17e01a6ce3956d79454047bfe4a3a405e89be7f (patch)
treee39df5d840d7b51c070364db857e164c211248c1
parent5f691c62b5fee61f72352dac324c3fef57cc8511 (diff)
downloadgcc-a17e01a6ce3956d79454047bfe4a3a405e89be7f.zip
gcc-a17e01a6ce3956d79454047bfe4a3a405e89be7f.tar.gz
gcc-a17e01a6ce3956d79454047bfe4a3a405e89be7f.tar.bz2
ada: Fix retrieval of spec entity from entry body entity
When retrieving entities of subprogram spec we only handled functions and procedures, but not entries. This had no consequences, because we then only applied checks to functions, but still is worth a cleanup, so the code is easier to adapt for access-to-subprogram entities as well. gcc/ada/ * sem_util.adb (Check_Result_And_Post_State): Properly handle entry bodies.
-rw-r--r--gcc/ada/sem_util.adb3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 1839214..d71329b 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -4582,6 +4582,9 @@ package body Sem_Util is
then
Spec_Id := Corresponding_Spec_Of_Stub (Subp_Decl);
+ elsif Nkind (Subp_Decl) = N_Entry_Body then
+ Spec_Id := Corresponding_Spec (Subp_Decl);
+
else
Spec_Id := Subp_Id;
end if;