[Ada] Dangling cursor checks in Element function
commit6534852011f3e72090c690ffc53b990feb709b9f
authorBob Duff <duff@adacore.com>
Mon, 11 Jun 2018 09:19:12 +0000 (11 09:19 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 11 Jun 2018 09:19:12 +0000 (11 09:19 +0000)
tree96875b19e41449a13338b35fcc0a99f1d4ad13b2
parent90265b93430c82d817deae512208a76f5241ea1c
[Ada] Dangling cursor checks in Element function

In Ada.Containers.Ordered_Maps, if a dangling cursor is passed to the Element
function, execution is erroneous. Therefore, the compiler is not obligated to
detect this error. However, this patch inserts code that will detect this error
in some cases, and raise Program_Error. The same applies to Ordered_Sets,
Ordered_Multisets, Indefinite_Ordered_Maps, Indefinite_Ordered_Sets, and
Indefinite_Ordered_Multisets. No test available for erroneous execution.

2018-06-11  Bob Duff  <duff@adacore.com>

gcc/ada/

* libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb,
libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb:
(Element): Add code to detect dangling cursors in some cases.

From-SVN: r261424
gcc/ada/ChangeLog
gcc/ada/libgnat/a-ciorma.adb
gcc/ada/libgnat/a-ciormu.adb
gcc/ada/libgnat/a-ciorse.adb
gcc/ada/libgnat/a-coorma.adb
gcc/ada/libgnat/a-coormu.adb
gcc/ada/libgnat/a-coorse.adb