2012-02-16 21:49:59 -07:00
|
|
|
// run
|
2010-04-30 15:04:34 -06:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2010 The Go Authors. All rights reserved.
|
2010-04-30 15:04:34 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2015-07-10 17:17:11 -06:00
|
|
|
// https://golang.org/issue/589
|
2010-04-30 15:04:34 -06:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
n := int64(100)
|
|
|
|
x := make([]int, n)
|
|
|
|
x[99] = 234;
|
|
|
|
z := x[n-1]
|
|
|
|
if z != 234 {
|
|
|
|
println("BUG")
|
|
|
|
}
|
|
|
|
n |= 1<<32
|
|
|
|
defer func() {
|
|
|
|
recover()
|
|
|
|
}()
|
|
|
|
z = x[n-1]
|
|
|
|
println("BUG2")
|
|
|
|
}
|