ada: Crash on function returning allocated object containing tasks
commit3e62561d5ffbb07fa97a4dddfd729fceb7cfce75
authorJavier Miranda <miranda@adacore.com>
Sun, 26 Mar 2023 11:45:50 +0000 (26 11:45 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 26 May 2023 07:29:19 +0000 (26 09:29 +0200)
tree5680497c88b5cc1a6d0b73ebe1597e5ae628193d
parent54783e61dd9bfd0f0289890ba9240deeef1af81a
ada: Crash on function returning allocated object containing tasks

The frontend crashes when a function returns an object of a
limited type that may have task components, has discriminants,
and the object is created with an allocator.

gcc/ada/

* exp_ch4.adb
(Expand_N_Allocator): If an allocator with constraints is called
in the return statement of a function returning a general access
type, then propagate to the itype the master of the general
access type (since it is the master associated with the
returned object).
gcc/ada/exp_ch4.adb