[Ada] Crash on 'Img attribute
authorJustin Squirek <squirek@adacore.com>
Tue, 9 Jul 2019 07:55:33 +0000 (07:55 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 9 Jul 2019 07:55:33 +0000 (07:55 +0000)
commit924e3532dcdabde43f5b49f1ef1a95656f4e37dc
tree296054b210f015a73f71c210e04f0945b8623db3
parent18934a8d0feb60be26513cfbb4b9d34a908a7602
[Ada] Crash on 'Img attribute

This patch fixes and issue whereby applying 'Img to a constant
enumerated character type would result in a compiler crash when
assertions are enabled and infinite recursion when they are not.

2019-07-09  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* sem_eval.adb (Expr_Value_E): Add conditional to correctly
handle constant enumerated character types.

gcc/testsuite/

* gnat.dg/image1.adb: New testcase.

From-SVN: r273292
gcc/ada/ChangeLog
gcc/ada/sem_eval.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/image1.adb [new file with mode: 0644]