We don't always have Convention_Protected, so test for presence of
Protected_Body_Subprogram.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-16  Richard Kenner  <ken...@adacore.com>

gcc/ada/

        * exp_unst.adb (Subp_Index): Change way we detect internal
        protected subprograms.
--- gcc/ada/exp_unst.adb
+++ gcc/ada/exp_unst.adb
@@ -282,7 +282,7 @@ package body Exp_Unst is
          --  has been scanned at this point, and thus has an entry in the
          --  subprogram table.
 
-         if E = Sub and then Convention (E) = Convention_Protected then
+         if E = Sub and then Present (Protected_Body_Subprogram (E)) then
             E := Protected_Body_Subprogram (E);
          end if;
 

Reply via email to