]> Cypherpunks repositories - gostls13.git/commitdiff
fix bug187 not to crash
authorRuss Cox <rsc@golang.org>
Wed, 12 Aug 2009 21:54:15 +0000 (14:54 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 12 Aug 2009 21:54:15 +0000 (14:54 -0700)
TBR=austin
DELTA=9  (4 added, 4 deleted, 1 changed)
OCL=33115
CL=33115

test/bugs/bug187.go
test/golden.out

index 8e7e14a872d3a18d61aa708064fa5a5b49b8e5a9..dafe6eaca71a8203fa6a874d2bdfaa22f04e2026 100644 (file)
@@ -6,13 +6,17 @@
 
 package main
 
+import "os"
+
 func main() {
        // This bug doesn't arise with [...]int, or []interface{} or [3]interface{}.
        a := [...]interface{} { 1, 2, 3 };
        n := 0;
+       bug := false;
        for _, v := range a {
                if v.(int) != n {
-                       panicln("BUG:", n, v.(int));
+                       println("BUG:", n, v.(int));
+                       os.Exit(0);
                }
                n++;
        }
index 16c16bbe5a39b91953361143749ac7c9f69585d4..c3a38b31305bdb12ea2ce700c0ec8232dc322d54 100644 (file)
@@ -156,7 +156,3 @@ BUG: errchk: command succeeded unexpectedly
 
 =========== bugs/bug187.go
 BUG: 0 1
-SIGSEGV: segmentation violation
-Faulting address: 0x40a1f0
-PC=0x40a1f0
-