diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-18 22:00:12 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-18 22:00:12 +0000 |
commit | 82fcdd47fa2522a974f0dbf4a32d53985a8b0451 (patch) | |
tree | cd94fa86e019b72460ee04cc6b412dec3af69e41 /gcc/ada | |
parent | 3e93aac2eaa30483078845a80a878bd4ca410d7a (diff) | |
download | gcc-82fcdd47fa2522a974f0dbf4a32d53985a8b0451.tar.gz |
PR ada/13470
* a-stunau.adb (Get_String): Don't return U.Reference, but Ret that is
set to the new string.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93857 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/a-stunau.adb | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1ad4753e252..00197507fee 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2005-01-18 Jakub Jelinek <jakub@redhat.com> + + PR ada/13470 + * a-stunau.adb (Get_String): Don't return U.Reference, but Ret that is + set to the new string. + 2005-01-18 Toon Moene <toon@moene.indiv.nluug.nl> * system-linux-ppc.ads: Set ZCX_By_Default and GCC_ZCX_Support diff --git a/gcc/ada/a-stunau.adb b/gcc/ada/a-stunau.adb index 2fe26cc8e72..9b23cb2d1f6 100644 --- a/gcc/ada/a-stunau.adb +++ b/gcc/ada/a-stunau.adb @@ -48,16 +48,18 @@ package body Ada.Strings.Unbounded.Aux is U_Ptr : constant Unbounded_String_Access := U'Unrestricted_Access; -- Unbounded_String is a controlled type which is always passed - -- by copy it is always safe to take the pointer to such object - -- here. This pointer is used to set the U.Reference value which - -- would not be possible otherwise as U is read-only. + -- by reference. It is always safe to take the pointer to such + -- object here. This pointer is used to set the U.Reference + -- value which would not be possible otherwise as U is read-only. Old : String_Access := U.Reference; + Ret : String_Access; begin - U_Ptr.Reference := new String'(U.Reference (1 .. U.Last)); + Ret := new String'(U.Reference (1 .. U.Last)); + U_Ptr.Reference := Ret; Free (Old); - return U.Reference; + return Ret; end; end if; end Get_String; |