From e1f3cb584d01e98206cea8feeb094ca025534ff7 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 24 Jun 2009 12:11:52 +0200 Subject: [multiple changes] 2009-06-24 Robert Dewar * prj-nmsc.adb, prj-nmsc.ads, prj-proc.adb, prj.adb: Minor reformatting * a-strsea.adb (Count): Avoid local copy on stack, speed up unmapped case. (Index): Ditto. 2009-06-24 Ed Schonberg * sem_ch4.adb (Analyze_One_Call): Check that at least one actual is present when checking whether a call may be interpreted as an indexing of the result of a call. * exp_ch9.adb (Expand_N_Subprogram_Declaration): Place the generated body for a null procedure on the freeze actions for the procedure, so that it will be analyzed at the proper place without premature freezing of actuals. * sem_ch3.adb (Check_Completion): Code cleanup. Do not diagnose a null procedure without a body, if previous errors have disabled expansion. 2009-06-24 Doug Rupp * init.c [VMS] Resignal C$_SIGKILL 2009-06-24 Ed Falis * s-vxwext.adb, s-vxwext-kernel.adb: Add s-vxwext body for VxWorks 5 Define ERROR in body for VxWorks 6 kernel 2009-06-24 Pascal Obry * g-socket.adb, g-socket.ads: Fix possible unexpected constraint error in [Send/Receive]_Socket. From-SVN: r148905 --- gcc/ada/g-socket.adb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'gcc/ada/g-socket.adb') diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index b15f52f..909cf0d 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -1617,7 +1617,15 @@ package body GNAT.Sockets is Raise_Socket_Error (Socket_Errno); end if; - Last := Item'First + Ada.Streams.Stream_Element_Offset (Res - 1); + if Res = 0 + and then Item'First = Ada.Streams.Stream_Element_Offset'First + then + -- No data sent and first index is first Stream_Element_Offset'First + -- Last is set to Stream_Element_Offset'Last. + Last := Ada.Streams.Stream_Element_Offset'Last; + else + Last := Item'First + Ada.Streams.Stream_Element_Offset (Res - 1); + end if; end Receive_Socket; -------------------- @@ -1889,7 +1897,15 @@ package body GNAT.Sockets is Raise_Socket_Error (Socket_Errno); end if; - Last := Item'First + Ada.Streams.Stream_Element_Offset (Res - 1); + if Res = 0 + and then Item'First = Ada.Streams.Stream_Element_Offset'First + then + -- No data sent and first index is first Stream_Element_Offset'First + -- Last is set to Stream_Element_Offset'Last. + Last := Ada.Streams.Stream_Element_Offset'Last; + else + Last := Item'First + Ada.Streams.Stream_Element_Offset (Res - 1); + end if; end Send_Socket; ----------------- -- cgit v1.1