summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-08-12 14:54:15 -0700
committerRuss Cox <rsc@golang.org>2009-08-12 14:54:15 -0700
commit41c4157070672f098735fdae79977a1979c10943 (patch)
treed88085bac7246f1ac0ce1918d503d7c3c1d79f97
parent977288bc7264e0f304db150193857937c17236f8 (diff)
downloadgolang-41c4157070672f098735fdae79977a1979c10943.tar.gz
fix bug187 not to crash
TBR=austin DELTA=9 (4 added, 4 deleted, 1 changed) OCL=33115 CL=33115
-rw-r--r--test/bugs/bug187.go6
-rw-r--r--test/golden.out4
2 files changed, 5 insertions, 5 deletions
diff --git a/test/bugs/bug187.go b/test/bugs/bug187.go
index 8e7e14a87..dafe6eaca 100644
--- a/test/bugs/bug187.go
+++ b/test/bugs/bug187.go
@@ -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++;
}
diff --git a/test/golden.out b/test/golden.out
index 16c16bbe5..c3a38b313 100644
--- a/test/golden.out
+++ b/test/golden.out
@@ -156,7 +156,3 @@ BUG: errchk: command succeeded unexpectedly
=========== bugs/bug187.go
BUG: 0 1
-SIGSEGV: segmentation violation
-Faulting address: 0x40a1f0
-PC=0x40a1f0
-