]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Fix wrong assumption on bounds in GNAT.Encode_String
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Jul 2019 13:56:55 +0000 (13:56 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Jul 2019 13:56:55 +0000 (13:56 +0000)
commit3474a75e77a7d573eccca3d8a2fd32e0dc2962de
treed2c89e2e6587d36af6c2b95c94a23dbeb3c04cc5
parenta7f20f4b03c308adeee79cf602c83544ead45a87
[Ada] Fix wrong assumption on bounds in GNAT.Encode_String

This fixes a couple of oversights in the GNAT.Encode_String package,
whose effect is to assume that all the strings have a lower bound of 1.

2019-07-22  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* libgnat/g-encstr.adb (Encode_Wide_String): Fix oversight.
(Encode_Wide_Wide_String): Likewise.

gcc/testsuite/

* gnat.dg/encode_string1.adb, gnat.dg/encode_string1_pkg.adb,
gnat.dg/encode_string1_pkg.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@273674 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/libgnat/g-encstr.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/encode_string1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/encode_string1_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/encode_string1_pkg.ads [new file with mode: 0644]