]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR ada/13470 (64bits Ada bootstrap failure:xnmake etc. crash generating nmake...
authorJakub Jelinek <jakub@redhat.com>
Tue, 18 Jan 2005 22:05:06 +0000 (23:05 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 18 Jan 2005 22:05:06 +0000 (23:05 +0100)
PR ada/13470
* a-stunau.adb (Get_String): Don't return U.Reference, but Ret that is
set to the new string.

From-SVN: r93858

gcc/ada/ChangeLog
gcc/ada/a-stunau.adb

index fb0e9feff0338d080aabfb41548e6de04bf83588..98559c931ad396c29a0fa72f45421ed5c0d35c1a 100644 (file)
@@ -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.
+
 2004-11-04  Release Manager
 
        * GCC 3.4.3 released.
index 2fe26cc8e723ef8846a1cd173533cc89f38adad8..9b23cb2d1f6961e8667c45bb70e3e99ac25ee7a8 100644 (file)
@@ -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;