[Ada] Crash on anonymous access-to-class-wide with tasks
authorBob Duff <duff@adacore.com>
Wed, 3 Jul 2019 08:16:24 +0000 (08:16 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 3 Jul 2019 08:16:24 +0000 (08:16 +0000)
commit336878fc11b75f8ac962efd9150151b74685f7fb
tree4f4e94aa14206a55d4f056b0747c282cf98fcc57
parent3f3dbb7b933c051e58544c8f3f98f587b498e5f5
[Ada] Crash on anonymous access-to-class-wide with tasks

This patch fixes a bug in which if an object declaration is of an
anonymous access type whose designated type is a limited class-wide type
(but not an interface), and the object is initialized with an allocator,
and the designated type of the allocator contains tasks, the compiler
would crash.

2019-07-03  Bob Duff  <duff@adacore.com>

gcc/ada/

* sem_ch3.adb (Access_Definition): The code was creating a
master in the case where the designated type is a class-wide
interface type. Create a master in the noninterface case as
well. That is, create a master for all limited class-wide types.

gcc/testsuite/

* gnat.dg/task2.adb, gnat.dg/task2_pkg.adb,
gnat.dg/task2_pkg.ads: New testcase.

From-SVN: r272986
gcc/ada/ChangeLog
gcc/ada/sem_ch3.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/task2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/task2_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/task2_pkg.ads [new file with mode: 0644]