]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Crash on if_expression used as index of discriminant-dependent array
authorEd Schonberg <schonberg@adacore.com>
Thu, 14 Jan 2021 22:54:05 +0000 (17:54 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 6 May 2021 07:51:20 +0000 (03:51 -0400)
commitc2f94a898f16d790e21533a6e0d345c23dd379a0
treeb8670e74409b7cff80753b552d4c1ecb292f6769
parentafab03da75f6b5e11087738d71aeb8c3efa40f1c
[Ada] Crash on if_expression used as index of discriminant-dependent array

gcc/ada/

* sem_res.adb (Resolve_If_Expression): If the context of the
expression is an indexed_component, resolve the expression and
its dependent_expressions with the base type of the index, to
ensure that an index check is generated when resolving the
enclosing indexxed_component, and avoid an improper use of
discriminants out of scope, when the index type is
discriminant-dependent.
gcc/ada/sem_res.adb