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

Side by Side Diff: test/live.go

Issue 64170043: code review 64170043: cmd/gc: correct liveness for fat variables (Closed)
Patch Set: diff -r a2b715d74188 https://code.google.com/p/go/ Created 11 years, 1 month 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:
View unified diff | Download patch
« no previous file with comments | « src/run.bash ('k') | test/live1.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // errorcheck -0 -l -live 1 // errorcheck -0 -l -live
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 package main 7 package main
8 8
9 func f1() { 9 func f1() {
10 var x *int 10 var x *int
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // similarly, select{} does not fall through. 175 // similarly, select{} does not fall through.
176 // this used to have a spurious "live at entry to f12: ~r0". 176 // this used to have a spurious "live at entry to f12: ~r0".
177 177
178 func f12() *int { 178 func f12() *int {
179 if b { 179 if b {
180 select{} 180 select{}
181 } else { 181 } else {
182 return nil 182 return nil
183 } 183 }
184 } 184 }
185
186 // incorrectly placed VARDEF annotations can cause missing liveness annotations.
187 // this used to be missing the fact that s is live during the call to g13 (becau se it is
188 // needed for the call to h13).
189
190 func f13() {
191 s := "hello"
192 s = h13(s, g13(s)) // ERROR "live at call to g13: s"
193 }
194
195 func g13(string) string
196 func h13(string, string) string
OLDNEW
« no previous file with comments | « src/run.bash ('k') | test/live1.go » ('j') | no next file with comments »

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