]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Crash on inlined separate subprogram
authorJustin Squirek <squirek@adacore.com>
Sun, 13 Jun 2021 16:52:18 +0000 (12:52 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 9 Jul 2021 12:35:30 +0000 (12:35 +0000)
gcc/ada/

* sem_ch6.adb (Check_Pragma_Inline): Correctly use
Corresponding_Spec_Of_Stub when dealing subprogram body stubs.

gcc/ada/sem_ch6.adb

index 78a076cf51a74bcffa2124e8158544e49225f376..304dc194243401e268f3df328004e5948fed4c79 100644 (file)
@@ -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);