diff options
| author | Russ Cox <rsc@golang.org> | 2009-12-15 16:59:23 -0800 | 
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-12-15 16:59:23 -0800 | 
| commit | 95c2d520268b58e378ddd3cb5ec4b3899a908b2f (patch) | |
| tree | eb3619506cdd45295783b391820580b7ab0f11ae /src/pkg/runtime/chan.c | |
| parent | be19867259d73e5c8396973bc5c011654922070e (diff) | |
| download | golang-95c2d520268b58e378ddd3cb5ec4b3899a908b2f.tar.gz | |
runtime: return zero value in x, ok = <-c when ok == false
Fixes issue 401.
R=ken2
http://codereview.appspot.com/180053
Diffstat (limited to 'src/pkg/runtime/chan.c')
| -rw-r--r-- | src/pkg/runtime/chan.c | 2 | 
1 files changed, 2 insertions, 0 deletions
| diff --git a/src/pkg/runtime/chan.c b/src/pkg/runtime/chan.c index 633ff426e..f0202cf66 100644 --- a/src/pkg/runtime/chan.c +++ b/src/pkg/runtime/chan.c @@ -307,6 +307,7 @@ loop:  	if(pres != nil) {  		unlock(c); +		c->elemalg->copy(c->elemsize, ep, nil);  		*pres = false;  		return;  	} @@ -335,6 +336,7 @@ asynch:  		if(pres != nil) {  			unlock(c); +			c->elemalg->copy(c->elemsize, ep, nil);  			*pres = false;  			return;  		} | 
