mirror of
https://github.com/golang/go
synced 2024-11-24 22:00:09 -07:00
runtime: better panic for send to nil channel
*Much* better on NaCl, where memory faults are deadly. R=r CC=golang-dev https://golang.org/cl/2249041
This commit is contained in:
parent
e769342614
commit
d4baf3ccb7
@ -403,6 +403,9 @@ void
|
||||
int32 o;
|
||||
byte *ae;
|
||||
|
||||
if(c == nil)
|
||||
panicstring("send to nil channel");
|
||||
|
||||
o = rnd(sizeof(c), c->elemalign);
|
||||
ae = (byte*)&c + o;
|
||||
chansend(c, ae, nil);
|
||||
@ -416,6 +419,9 @@ void
|
||||
int32 o;
|
||||
byte *ae, *ap;
|
||||
|
||||
if(c == nil)
|
||||
panicstring("send to nil channel");
|
||||
|
||||
o = rnd(sizeof(c), c->elemalign);
|
||||
ae = (byte*)&c + o;
|
||||
o = rnd(o+c->elemsize, Structrnd);
|
||||
|
Loading…
Reference in New Issue
Block a user