Source file
test/fixedbugs/issue26407.go
1
2
3
4
5
6
7
8
9
10
11 package main
12
13 func main() {
14 poison()
15 test()
16 }
17
18
19 func poison() {
20
21 var large [256]uintptr
22 for i := range large {
23 large[i] = 1
24 }
25 use(large[:])
26 }
27
28
29 func test() {
30 a := 2
31 x := &a
32 if x != compare(&x) {
33 panic("not possible")
34 }
35 }
36
37
38 func compare(x **int) *int {
39 var y *int
40 if x == &y {
41 panic("not possible")
42 }
43
44 grow()
45 if x == &y {
46 panic("not possible")
47 }
48 return *x
49 }
50
51
52 func grow() {
53 var large [1 << 16]uintptr
54 use(large[:])
55 }
56
57
58 func use(_ []uintptr) { }
59
View as plain text