[Ada] Fix wrong assumption on bounds in GNAT.Encode_String
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 22 Jul 2019 13:56:55 +0000 (13:56 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 22 Jul 2019 13:56:55 +0000 (13:56 +0000)
commit52860cc145a7075a9f30840703f96b242cd0150f
treed2c89e2e6587d36af6c2b95c94a23dbeb3c04cc5
parentf3d2fbfdb83bcc60d72824daf7a470c0e5398854
[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.

From-SVN: r273674
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]