[Ada] Fix run-time segfault with derived access-to-subprogram type
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 19 Sep 2019 08:13:48 +0000 (08:13 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 19 Sep 2019 08:13:48 +0000 (08:13 +0000)
commit46a500a5cc81138ada165e97e63aed7bea4103e2
tree0ee8d456a508563c64f8736836250e86421007c6
parentf5766e3b541a9fb2d4365281f5c9da4f80e9622c
[Ada] Fix run-time segfault with derived access-to-subprogram type

This fixes a segfault at run time for the call to a local subprogram
through an access value if the type of this access value is derived
from an initial access-to-subprogram type and the access value was
originally obtained with the initial type.

2019-09-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* sem_ch3.adb (Build_Derived_Access_Type): If this is an access-
to-subprogram type, copy Can_Use_Internal_Rep from the parent.

gcc/testsuite/

* gnat.dg/access9.adb: New testcase.

From-SVN: r275945
gcc/ada/ChangeLog
gcc/ada/sem_ch3.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/access9.adb [new file with mode: 0644]