[Ada] Crash on discriminant check with current instance
authorJustin Squirek <squirek@adacore.com>
Thu, 3 Dec 2020 15:06:26 +0000 (10:06 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 17 Dec 2020 10:49:21 +0000 (05:49 -0500)
commitf6219730a1ac4a24cbbc2428e3f30e1b11abe1e8
tree935f358a32c8fd555795a481dde3fc512a686bbb
parent383814537116f6a3c5c08aa9a9069fb9f438d52c
[Ada] Crash on discriminant check with current instance

gcc/ada/

* checks.adb (Build_Discriminant_Checks): Add condition to
replace references to the current instance of the type when we
are within an Init_Proc.
(Replace_Current_Instance): Examine a given node and replace the
current instance of the type with the corresponding _init
formal.
(Search_And_Replace_Current_Instance): Traverse proc which calls
Replace_Current_Instance in order to replace all references
within a given expression.
gcc/ada/checks.adb