diff mbox

[gccgo] Correct nonblocking receive of large value

Message ID mcrhbkp1gl0.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor June 27, 2010, 12:09 a.m. UTC
I managed to write the code for a nonblocking receive of a large value
on a channel incorrectly.  Oddly, nothing noticed until I recently ran
the tests on a 64-bit system.  This patch fixes the problem.  Committed
to gccgo branch.

Ian
diff mbox

Patch

diff -r f58cfc636c53 libgo/runtime/go-rec-nb-big.c
--- a/libgo/runtime/go-rec-nb-big.c	Sat Jun 26 17:01:41 2010 -0700
+++ b/libgo/runtime/go-rec-nb-big.c	Sat Jun 26 17:07:26 2010 -0700
@@ -31,7 +31,7 @@ 
 	}
     }
 
-  offset = channel->next_store * alloc_size;
+  offset = channel->next_fetch * alloc_size;
   __builtin_memcpy (val, &channel->data[offset], channel->element_size);
 
   __go_receive_release (channel);