Source file
test/escape_field.go
1
2
3
4
5
6
7
8
9 package escape
10
11 var sink interface{}
12
13 type X struct {
14 p1 *int
15 p2 *int
16 a [2]*int
17 }
18
19 type Y struct {
20 x X
21 }
22
23 func field0() {
24 i := 0
25 var x X
26 x.p1 = &i
27 sink = x.p1
28 }
29
30 func field1() {
31 i := 0
32 var x X
33
34 x.p1 = &i
35 sink = x.p2
36 }
37
38 func field3() {
39 i := 0
40 var x X
41 x.p1 = &i
42 sink = x
43 }
44
45 func field4() {
46 i := 0
47 var y Y
48 y.x.p1 = &i
49 x := y.x
50 sink = x
51 }
52
53 func field5() {
54 i := 0
55 var x X
56
57 x.a[0] = &i
58 sink = x.a[1]
59 }
60
61
62 func field6(x *X) {
63 sink = x.p2
64 }
65
66 func field6a() {
67 i := 0
68 var x X
69
70 x.p1 = &i
71 field6(&x)
72 }
73
74 func field7() {
75 i := 0
76 var y Y
77 y.x.p1 = &i
78 x := y.x
79 var y1 Y
80 y1.x = x
81 _ = y1.x.p1
82 }
83
84 func field8() {
85 i := 0
86 var y Y
87 y.x.p1 = &i
88 x := y.x
89 var y1 Y
90 y1.x = x
91 sink = y1.x.p1
92 }
93
94 func field9() {
95 i := 0
96 var y Y
97 y.x.p1 = &i
98 x := y.x
99 var y1 Y
100 y1.x = x
101 sink = y1.x
102 }
103
104 func field10() {
105 i := 0
106 var y Y
107
108 y.x.p1 = &i
109 x := y.x
110 var y1 Y
111 y1.x = x
112 sink = y1.x.p2
113 }
114
115 func field11() {
116 i := 0
117 x := X{p1: &i}
118 sink = x.p1
119 }
120
121 func field12() {
122 i := 0
123
124 x := X{p1: &i}
125 sink = x.p2
126 }
127
128 func field13() {
129 i := 0
130 x := &X{p1: &i}
131 sink = x.p1
132 }
133
134 func field14() {
135 i := 0
136
137 x := &X{p1: &i}
138 sink = x.p2
139 }
140
141 func field15() {
142 i := 0
143 x := &X{p1: &i}
144 sink = x
145 }
146
147 func field16() {
148 i := 0
149 var x X
150
151 x.p1 = &i
152 var iface interface{} = x
153 x1 := iface.(X)
154 sink = x1.p2
155 }
156
157 func field17() {
158 i := 0
159 var x X
160 x.p1 = &i
161 var iface interface{} = x
162 x1 := iface.(X)
163 sink = x1.p1
164 }
165
166 func field18() {
167 i := 0
168 var x X
169
170 x.p1 = &i
171 var iface interface{} = x
172 y, _ := iface.(Y)
173 sink = y
174 }
175
View as plain text