[Ada] Fix crashes on ownership checking in SPARK
authorYannick Moy <moy@adacore.com>
Wed, 10 Jul 2019 09:00:48 +0000 (09:00 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 10 Jul 2019 09:00:48 +0000 (09:00 +0000)
commit74b96685bb00766f8931c95d45d6e2c4d719cf1a
treec6d62cb0553dd1c03f98c9d4090d3d85718f21ac
parent5a6446841aa17a717f2f04ec22e507c86c864355
[Ada] Fix crashes on ownership checking in SPARK

Code that violates the conditions for ownership checking should lead to
error messages pointing to the violations instead of crashes.

There is no impact on compilation, only GNATprove.

2019-07-10  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_spark.adb (Get_Root_Object): Replace precondition by error
message.
(Read_Indexes): Replace precondition by error message.
(Check_Callable_Body): Check only traversal function returns an
anonymous access type.
(Check_Expression): Issue error on unexpected expression as
path.
* sem_util.adb (First_Global): Fix access to global on
entry/task.

From-SVN: r273329
gcc/ada/ChangeLog
gcc/ada/sem_spark.adb
gcc/ada/sem_util.adb