Commit cec007d3 authored by Russ Cox's avatar Russ Cox

runtime: better error for send/recv on nil channel

R=ken2
CC=golang-dev
https://golang.org/cl/1835041
parent 041d1162
...@@ -182,6 +182,9 @@ chansend(Hchan *c, byte *ep, bool *pres) ...@@ -182,6 +182,9 @@ chansend(Hchan *c, byte *ep, bool *pres)
SudoG *sg; SudoG *sg;
G* gp; G* gp;
if(c == nil)
panicstring("send to nil channel");
if(gcwaiting) if(gcwaiting)
gosched(); gosched();
...@@ -286,6 +289,9 @@ chanrecv(Hchan* c, byte *ep, bool* pres) ...@@ -286,6 +289,9 @@ chanrecv(Hchan* c, byte *ep, bool* pres)
SudoG *sg; SudoG *sg;
G *gp; G *gp;
if(c == nil)
panicstring("receive from nil channel");
if(gcwaiting) if(gcwaiting)
gosched(); gosched();
......
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