]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Dangling cursor checks in Element function
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Jun 2018 09:19:12 +0000 (09:19 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Jun 2018 09:19:12 +0000 (09:19 +0000)
commitef695c17b2e478d6a17007f358e3a56909a39ab5
tree96875b19e41449a13338b35fcc0a99f1d4ad13b2
parent178ba9a26d32bd7ed0f17b79eefc3e31c8d465bc
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261424 138bc75d-0d04-0410-961f-82ee72b054a4
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