Commit 4d960a7e by Jakub Jelinek Committed by Jakub Jelinek

re PR ada/13470 (64bits Ada bootstrap failure:xnmake etc. crash generating nmake.adb etc.)

	PR ada/13470
	* a-stunau.adb (Get_String): Don't return U.Reference, but Ret that is
	set to the new string.

From-SVN: r93857
parent b4c6a3a2
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> 2005-01-18 Toon Moene <toon@moene.indiv.nluug.nl>
* system-linux-ppc.ads: Set ZCX_By_Default and GCC_ZCX_Support * system-linux-ppc.ads: Set ZCX_By_Default and GCC_ZCX_Support
......
...@@ -48,16 +48,18 @@ package body Ada.Strings.Unbounded.Aux is ...@@ -48,16 +48,18 @@ package body Ada.Strings.Unbounded.Aux is
U_Ptr : constant Unbounded_String_Access := U'Unrestricted_Access; U_Ptr : constant Unbounded_String_Access := U'Unrestricted_Access;
-- Unbounded_String is a controlled type which is always passed -- Unbounded_String is a controlled type which is always passed
-- by copy it is always safe to take the pointer to such object -- by reference. It is always safe to take the pointer to such
-- here. This pointer is used to set the U.Reference value which -- object here. This pointer is used to set the U.Reference
-- would not be possible otherwise as U is read-only. -- value which would not be possible otherwise as U is read-only.
Old : String_Access := U.Reference; Old : String_Access := U.Reference;
Ret : String_Access;
begin 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); Free (Old);
return U.Reference; return Ret;
end; end;
end if; end if;
end Get_String; end Get_String;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment