You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/live.go
+27-21
Original file line number
Diff line number
Diff line change
@@ -141,7 +141,7 @@ var i9 interface{}
141
141
funcf9() bool {
142
142
g8()
143
143
x:=i9
144
-
y:=interface{}(99.0i)// ERROR "live at call to convT2E: x.data x.type$"
144
+
y:=interface{}(str())// ERROR "live at call to convT2E: .autotmp_[0-9]+ x.data x.type$" "live at call to str: x.data x.type$"
145
145
i9=y// make y escape so the line above has to call convT2E
146
146
returnx!=y
147
147
}
@@ -256,12 +256,15 @@ func g15() string
256
256
257
257
varmmap[string]int
258
258
259
+
// str is used to ensure that a temp is required for runtime calls below.
260
+
funcstr() string
261
+
259
262
funcf16() {
260
263
ifb {
261
-
delete(m, "hi") // ERROR "live at call to mapdelete: .autotmp_[0-9]+$"
264
+
delete(m, str()) // ERROR "live at call to mapdelete: .autotmp_[0-9]+$"
262
265
}
263
-
delete(m, "hi") // ERROR "live at call to mapdelete: .autotmp_[0-9]+$"
264
-
delete(m, "hi") // ERROR "live at call to mapdelete: .autotmp_[0-9]+$"
266
+
delete(m, str()) // ERROR "live at call to mapdelete: .autotmp_[0-9]+$"
267
+
delete(m, str()) // ERROR "live at call to mapdelete: .autotmp_[0-9]+$"
265
268
}
266
269
267
270
varm2smap[string]*byte
@@ -280,19 +283,19 @@ func f17a(p *byte) { // ERROR "live at entry to f17a: p$"
280
283
funcf17b(p*byte) { // ERROR "live at entry to f17b: p$"
281
284
// key temporary
282
285
ifb {
283
-
m2s["x"] =p// ERROR "live at call to mapassign: p .autotmp_[0-9]+$"
286
+
m2s[str()] =p// ERROR "live at call to mapassign: p .autotmp_[0-9]+$" "live at call to str: p$"
284
287
}
285
-
m2s["x"] =p// ERROR "live at call to mapassign: p .autotmp_[0-9]+$"
286
-
m2s["x"] =p// ERROR "live at call to mapassign: p .autotmp_[0-9]+$"
288
+
m2s[str()] =p// ERROR "live at call to mapassign: p .autotmp_[0-9]+$" "live at call to str: p$"
289
+
m2s[str()] =p// ERROR "live at call to mapassign: p .autotmp_[0-9]+$" "live at call to str: p$"
287
290
}
288
291
289
292
funcf17c() {
290
293
// key and value temporaries
291
294
ifb {
292
-
m2s["x"] =f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+ .autotmp_[0-9]+$"
295
+
m2s[str()] =f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+ .autotmp_[0-9]+$"
293
296
}
294
-
m2s["x"] =f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+ .autotmp_[0-9]+$"
295
-
m2s["x"] =f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+ .autotmp_[0-9]+$"
297
+
m2s[str()] =f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+ .autotmp_[0-9]+$"
298
+
m2s[str()] =f17d() // ERROR "live at call to f17d: .autotmp_[0-9]+$" "live at call to mapassign: .autotmp_[0-9]+ .autotmp_[0-9]+$"
296
299
}
297
300
298
301
funcf17d() *byte
@@ -313,6 +316,9 @@ func f18() {
313
316
314
317
varchchan*byte
315
318
319
+
// byteptr is used to ensure that a temp is required for runtime calls below.
320
+
funcbyteptr() *byte
321
+
316
322
funcf19() {
317
323
// dest temporary for channel receive.
318
324
varz*byte
@@ -328,10 +334,10 @@ func f19() {
328
334
funcf20() {
329
335
// src temporary for channel send
330
336
ifb {
331
-
ch<-nil// ERROR "live at call to chansend1: .autotmp_[0-9]+$"
337
+
ch<-byteptr()// ERROR "live at call to chansend1: .autotmp_[0-9]+$"
332
338
}
333
-
ch<-nil// ERROR "live at call to chansend1: .autotmp_[0-9]+$"
334
-
ch<-nil// ERROR "live at call to chansend1: .autotmp_[0-9]+$"
339
+
ch<-byteptr()// ERROR "live at call to chansend1: .autotmp_[0-9]+$"
340
+
ch<-byteptr()// ERROR "live at call to chansend1: .autotmp_[0-9]+$"
335
341
}
336
342
337
343
funcf21() {
@@ -488,13 +494,13 @@ func f30(b bool) {
488
494
489
495
funcf31(b1, b2, b3bool) {
490
496
ifb1 {
491
-
g31("a") // ERROR "live at call to convT2E: .autotmp_[0-9]+$" "live at call to g31: .autotmp_[0-9]+$"
497
+
g31(str()) // ERROR "live at call to convT2E: .autotmp_[0-9]+$" "live at call to g31: .autotmp_[0-9]+$"
492
498
}
493
499
ifb2 {
494
-
h31("b") // ERROR "live at call to convT2E: .autotmp_[0-9]+ .autotmp_[0-9]+$" "live at call to h31: .autotmp_[0-9]+$" "live at call to newobject: .autotmp_[0-9]+$"
500
+
h31(str()) // ERROR "live at call to convT2E: .autotmp_[0-9]+ .autotmp_[0-9]+$" "live at call to h31: .autotmp_[0-9]+$" "live at call to newobject: .autotmp_[0-9]+$"
495
501
}
496
502
ifb3 {
497
-
panic("asdf") // ERROR "live at call to convT2E: .autotmp_[0-9]+$" "live at call to gopanic: .autotmp_[0-9]+$"
503
+
panic(str()) // ERROR "live at call to convT2E: .autotmp_[0-9]+$" "live at call to gopanic: .autotmp_[0-9]+$"
498
504
}
499
505
print(b3)
500
506
}
@@ -529,7 +535,7 @@ func call32(func())
529
535
varm33map[interface{}]int
530
536
531
537
funcf33() {
532
-
ifm33[nil] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
538
+
ifm33[byteptr()] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
533
539
printnl()
534
540
return
535
541
} else {
@@ -539,31 +545,31 @@ func f33() {
539
545
}
540
546
541
547
funcf34() {
542
-
ifm33[nil] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
548
+
ifm33[byteptr()] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
543
549
printnl()
544
550
return
545
551
}
546
552
printnl()
547
553
}
548
554
549
555
funcf35() {
550
-
ifm33[nil] ==0&&m33[nil] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
556
+
ifm33[byteptr()] ==0&&m33[byteptr()] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
551
557
printnl()
552
558
return
553
559
}
554
560
printnl()
555
561
}
556
562
557
563
funcf36() {
558
-
ifm33[nil] ==0||m33[nil] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
564
+
ifm33[byteptr()] ==0||m33[byteptr()] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
559
565
printnl()
560
566
return
561
567
}
562
568
printnl()
563
569
}
564
570
565
571
funcf37() {
566
-
if (m33[nil] ==0||m33[nil] ==0) &&m33[nil] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
572
+
if (m33[byteptr()] ==0||m33[byteptr()] ==0) &&m33[byteptr()] ==0 { // ERROR "live at call to mapaccess1: .autotmp_[0-9]+$"
0 commit comments