aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2021-06-13 12:52:18 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-09 12:35:30 +0000
commit765ca22b1792b613d2801b6d2ef9986e18bba3ab (patch)
treec68130988686e0c546b2d2c7895d6e7f4d7810b6 /gcc/ada
parent175c2f98ea85004f23acc4b40f0e4264420116fc (diff)
downloadgcc-765ca22b1792b613d2801b6d2ef9986e18bba3ab.zip
gcc-765ca22b1792b613d2801b6d2ef9986e18bba3ab.tar.gz
gcc-765ca22b1792b613d2801b6d2ef9986e18bba3ab.tar.bz2
[Ada] Crash on inlined separate subprogram
gcc/ada/ * sem_ch6.adb (Check_Pragma_Inline): Correctly use Corresponding_Spec_Of_Stub when dealing subprogram body stubs.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_ch6.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 78a076c..304dc19 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -3454,7 +3454,12 @@ package body Sem_Ch6 is
-- Link the body and the generated spec
Set_Corresponding_Body (Decl, Body_Id);
- Set_Corresponding_Spec (N, Subp);
+
+ if Nkind (N) = N_Subprogram_Body_Stub then
+ Set_Corresponding_Spec_Of_Stub (N, Subp);
+ else
+ Set_Corresponding_Spec (N, Subp);
+ end if;
Set_Defining_Unit_Name (Specification (Decl), Subp);