]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix retrieval of spec entity from entry body entity
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 29 Mar 2023 14:21:01 +0000 (16:21 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 29 May 2023 08:23:19 +0000 (10:23 +0200)
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.

gcc/ada/sem_util.adb

index 1839214332d6378286e1983bf1336ccb7f625830..d71329bbcb29cb58aa3f664c163458e46545979f 100644 (file)
@@ -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;