]> Cypherpunks repositories - gostls13.git/commitdiff
compiler catches out of bounds; work around
authorRob Pike <r@golang.org>
Tue, 25 Nov 2008 00:23:49 +0000 (16:23 -0800)
committerRob Pike <r@golang.org>
Tue, 25 Nov 2008 00:23:49 +0000 (16:23 -0800)
R=ken
OCL=19943
CL=19943

test/ken/array.go

index 0dac2a6893cfec3580d24c2628bfa5bca05dd5b0..918bb5b6fc5f1bea4cd8c37e8f318076a7b7a218 100644 (file)
@@ -139,7 +139,8 @@ testfdfault()
                a[i] = 0;
        }
        print("should fault\n");
-       a[80] = 0;
+       x := 80;
+       a[x] = 0;
        print("bad\n");
 }