]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] fix crash on Secondary_Stack_Size with discriminant
authorBob Duff <duff@adacore.com>
Fri, 28 Jan 2022 19:40:27 +0000 (14:40 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 11 May 2022 08:53:19 +0000 (08:53 +0000)
commit6281d36342c29cdd9acb32032f59bf440953c942
treeca109690a0c1cfd96417b991e962f397ff623c19
parent470fff3d8e48ede98f0a74a1beb9eafc7452f4b4
[Ada] fix crash on Secondary_Stack_Size with discriminant

This patch fixes a crash caused by specifying the Secondary_Stack_Size
aspect of a task type as the value of a discriminant of the task type,
and then declaring a record component whose type is the task type,
constrained to a discriminant of the record.

gcc/ada/

* sem_ch3.adb (Get_Discr_Value): Copy the result. Otherwise, the
"tree" can be malformed (a DAG, not a tree) because
Get_Discr_Value could be returning some subtree already attached
to the tree.
gcc/ada/sem_ch3.adb