aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2018-06-11 09:18:33 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-06-11 09:18:33 +0000
commit09adaa8d122955d9661b01d2fe005975e1331f46 (patch)
treeb13a157d215eb69677fbf63564fe950eb9337751 /gcc/ada
parent3e6845df1eb61c3c8d779e5590811ed1cbd04270 (diff)
downloadgcc-09adaa8d122955d9661b01d2fe005975e1331f46.zip
gcc-09adaa8d122955d9661b01d2fe005975e1331f46.tar.gz
gcc-09adaa8d122955d9661b01d2fe005975e1331f46.tar.bz2
[Ada] Crash on protected type entry family
The compiler may blow up compiling a the body of a protected type that has a family entry whose entry index specification contains a call to a function. 2018-06-11 Javier Miranda <miranda@adacore.com> gcc/ada/ * exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of N_Call_Marker nodes. gcc/testsuite/ * gnat.dg/prot4.adb: New testcase. From-SVN: r261417
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/exp_ch9.adb7
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3314303..cafac4f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-11 Javier Miranda <miranda@adacore.com>
+
+ * exp_ch9.adb (Expand_N_Protected_Body): Add missing handling of
+ N_Call_Marker nodes.
+
2018-06-11 Arnaud Charlet <charlet@adacore.com>
* exp_ch3.adb, exp_unst.adb, inline.adb, sem_prag.adb: Minor
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 981c0ee..7cb5068 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -8653,8 +8653,11 @@ package body Exp_Ch9 is
when N_Implicit_Label_Declaration =>
null;
- when N_Itype_Reference =>
- Insert_After (Current_Node, New_Copy (Op_Body));
+ when N_Call_Marker |
+ N_Itype_Reference =>
+ New_Op_Body := New_Copy (Op_Body);
+ Insert_After (Current_Node, New_Op_Body);
+ Current_Node := New_Op_Body;
when N_Freeze_Entity =>
New_Op_Body := New_Copy (Op_Body);