1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:34:40 -07:00

Don't check array bounds if we have been told not to.

Fixes range.go test for 6g.

R=rsc
CC=golang-dev
https://golang.org/cl/189093
This commit is contained in:
Ian Lance Taylor 2010-01-15 13:51:57 -08:00
parent 08d3f5e271
commit c332ff42fe
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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