aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/chan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/chan.c')
-rw-r--r--src/pkg/runtime/chan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/runtime/chan.c b/src/pkg/runtime/chan.c
index 78f67b817c..efaceebf5a 100644
--- a/src/pkg/runtime/chan.c
+++ b/src/pkg/runtime/chan.c
@@ -97,7 +97,7 @@ runtime·makechan_c(Type *elem, int64 hint)
int32 n;
byte *by;
- if(hint < 0 || (int32)hint != hint || hint > ((uintptr)-1) / elem->size)
+ if(hint < 0 || (int32)hint != hint || (elem->size > 0 && hint > ((uintptr)-1) / elem->size))
runtime·panicstring("makechan: size out of range");
if(elem->alg >= nelem(runtime·algarray)) {