Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(977)

Delta Between Two Patch Sets: test/live2.go

Issue 169120043: [dev.garbage] code review 169120043: cmd/gc, runtime: add locks around print statements (Closed)
Left Patch Set: diff -r cec3f055c47e2123c243917bd738f9148d34b85d https://code.google.com/p/go/ Created 10 years, 5 months ago
Right Patch Set: diff -r 515faabb8b4beef7f5aa924199e5036f4cc35fc7 https://code.google.com/p/go/ Created 10 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « test/live.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // errorcheck -0 -live -wb=0 1 // errorcheck -0 -live -wb=0
2 2
3 // Copyright 2014 The Go Authors. All rights reserved. 3 // Copyright 2014 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style 4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file. 5 // license that can be found in the LICENSE file.
6 6
7 // liveness tests with inlining ENABLED 7 // liveness tests with inlining ENABLED
8 // see also live.go. 8 // see also live.go.
9 9
10 package main 10 package main
11 11
12 // issue 8142: lost 'addrtaken' bit on inlined variables. 12 // issue 8142: lost 'addrtaken' bit on inlined variables.
13 // no inlining in this test, so just checking that non-inlined works. 13 // no inlining in this test, so just checking that non-inlined works.
14 14
15 func printnl()
16
15 type T40 struct { 17 type T40 struct {
16 m map[int]int 18 m map[int]int
17 } 19 }
18 20
19 func newT40() *T40 { 21 func newT40() *T40 {
20 ret := T40{} 22 ret := T40{}
21 ret.m = make(map[int]int) // ERROR "live at call to makemap: &ret" 23 ret.m = make(map[int]int) // ERROR "live at call to makemap: &ret"
22 return &ret 24 return &ret
23 } 25 }
24 26
25 func bad40() { 27 func bad40() {
26 t := newT40() // ERROR "live at call to makemap: ret" 28 t := newT40() // ERROR "live at call to makemap: ret"
27 » println() // ERROR "live at call to printnl: ret" 29 » printnl() // ERROR "live at call to printnl: ret"
28 _ = t 30 _ = t
29 } 31 }
30 32
31 func good40() { 33 func good40() {
32 ret := T40{} 34 ret := T40{}
33 ret.m = make(map[int]int) // ERROR "live at call to makemap: ret" 35 ret.m = make(map[int]int) // ERROR "live at call to makemap: ret"
34 t := &ret 36 t := &ret
35 » println() // ERROR "live at call to printnl: ret" 37 » printnl() // ERROR "live at call to printnl: ret"
36 _ = t 38 _ = t
37 } 39 }
LEFTRIGHT
« test/live.go ('k') | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b