aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2021-01-20 04:50:14 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-06 03:51:33 -0400
commite18e1b5f524507fd7b7d8bd4d674bc63333a5679 (patch)
tree64b3ac6dd80d8b4b60500382750faacaaa795b69 /gcc
parent952da35cc67000445ca18d3ee8213d7c71a4b3a4 (diff)
downloadgcc-e18e1b5f524507fd7b7d8bd4d674bc63333a5679.zip
gcc-e18e1b5f524507fd7b7d8bd4d674bc63333a5679.tar.gz
gcc-e18e1b5f524507fd7b7d8bd4d674bc63333a5679.tar.bz2
[Ada] Assert failure on pragma Inline in procedure body
gcc/ada/ * sem_ch6.adb (Is_Inline_Pragma): Protect against N not being a list member in both branches.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch6.adb6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index a53540d..a919a0a 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -3416,15 +3416,13 @@ package body Sem_Ch6 is
Prag := Empty;
end if;
- if Present (Prag) then
+ if Present (Prag) and then Is_List_Member (N) then
if Present (Spec_Id) then
- if Is_List_Member (N)
- and then Is_List_Member (Unit_Declaration_Node (Spec_Id))
+ if Is_List_Member (Unit_Declaration_Node (Spec_Id))
and then In_Same_List (N, Unit_Declaration_Node (Spec_Id))
then
Analyze (Prag);
end if;
-
else
-- Create a subprogram declaration, to make treatment uniform.
-- Make the sloc of the subprogram name that of the entity in