mirror of https://github.com/golang/go.git
fix bug187 not to crash
TBR=austin DELTA=9 (4 added, 4 deleted, 1 changed) OCL=33115 CL=33115
This commit is contained in:
parent
a92610208e
commit
66beb2fd3b
|
|
@ -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++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,3 @@ BUG: errchk: command succeeded unexpectedly
|
|||
|
||||
=========== bugs/bug187.go
|
||||
BUG: 0 1
|
||||
SIGSEGV: segmentation violation
|
||||
Faulting address: 0x40a1f0
|
||||
PC=0x40a1f0
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue