Commit d4baf3cc authored by Russ Cox's avatar Russ Cox

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
parent e7693426
......@@ -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);
......
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