]> Cypherpunks repositories - gostls13.git/commitdiff
Don't check array bounds if we have been told not to.
authorIan Lance Taylor <iant@golang.org>
Fri, 15 Jan 2010 21:51:57 +0000 (13:51 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 15 Jan 2010 21:51:57 +0000 (13:51 -0800)
Fixes range.go test for 6g.

R=rsc
CC=golang-dev
https://golang.org/cl/189093

src/cmd/5g/cgen.c
src/cmd/6g/cgen.c

index dea94dc08d29602a822475bb0f41731c59f110e3..48d5e3c221cd8cd7cdc8db2aeb1cd6111f9eb176 100644 (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
index 1e7c6e4427783c9e9c389b87be6a2bde5a567719..483c093c83c5a8684ab1a901fdcfb8a2e6b5dbf3 100644 (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