diff --git a/src/cmd/5g/cgen.c b/src/cmd/5g/cgen.c index dea94dc08d2..48d5e3c221c 100644 --- a/src/cmd/5g/cgen.c +++ b/src/cmd/5g/cgen.c @@ -571,7 +571,7 @@ agen(Node *n, Node *res) n1.xoffset = Array_array; gmove(&n1, &n3); } else - if(!debug['B']) { + if(!debug['B'] && !n->etype) { if(v < 0) yyerror("out of bounds on array"); else diff --git a/src/cmd/6g/cgen.c b/src/cmd/6g/cgen.c index 1e7c6e44277..483c093c83c 100644 --- a/src/cmd/6g/cgen.c +++ b/src/cmd/6g/cgen.c @@ -522,7 +522,7 @@ agen(Node *n, Node *res) n1.xoffset = Array_array; gmove(&n1, &n3); } else - if(!debug['B']) { + if(!debug['B'] && !n->etype) { if(v < 0) yyerror("out of bounds on array"); else