]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Crash on ignored Ghost assignment
authorHristian Kirtchev <kirtchev@adacore.com>
Wed, 14 Nov 2018 11:41:14 +0000 (11:41 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 14 Nov 2018 11:41:14 +0000 (11:41 +0000)
commitb3b3ada9a000ee3ebda203debead999a37fa1094
treef665ea118030a350634cee2721e5f769b12e3a7a
parent7f0f5de19093d4550b48d3a26f1869e8def3f7e8
[Ada] Crash on ignored Ghost assignment

This patch modifies the way analysis determine whether an assignment is
an ignored Ghost assignment. This is now achieved by preanalyzing a copy
of the left hand side in order to account for potential code generated
by the left hand side itself.

No small reproducer possible.

2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* ghost.adb (Ghost_Entity): New routine.
(Mark_And_Set_Ghost_Assignment): Reimplemented.
* sem_ch5.adb (Analyze_Assignment): Assess whether the target of
the assignment is an ignored Ghost entity before analyzing the
left hand side.
* sem_ch8.adb (Find_Direct_Name): Update the subprogram
signature. Do not generate markers and references when they are
not desired.
(Nvis_Messages): Do not execute when errors are not desired.
(Undefined): Do not emit errors when they are not desired.
* sem_ch8.ads (Find_Direct_Name): Update the subprogram
signature and comment on usage.
* sem_util.adb (Ultimate_Prefix): New routine.
* sem_util.ads (Ultimate_Prefix): New routine.

From-SVN: r266120
gcc/ada/ChangeLog
gcc/ada/ghost.adb
gcc/ada/sem_ch5.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_ch8.ads
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads