]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/types: don't return *Sym from Pushdcl (it's never used)
authorRobert Griesemer <gri@golang.org>
Fri, 7 Apr 2017 17:53:40 +0000 (10:53 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 7 Apr 2017 20:07:35 +0000 (20:07 +0000)
Change-Id: Ib55f7ea3f7dcd9d02f6027121663870a65cb886c
Reviewed-on: https://go-review.googlesource.com/39924
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/noder.go
src/cmd/compile/internal/types/scope.go

index 1ad19df7df39f73dc088c92c3a209d6e4c5185b4..3d6eaf6e8178c166ac08af02f9c9e889a699a571 100644 (file)
@@ -909,7 +909,7 @@ func (p *noder) commClauses(clauses []*syntax.CommClause) []*Node {
 
 func (p *noder) labeledStmt(label *syntax.LabeledStmt) *Node {
        lhs := p.nod(label, OLABEL, p.newname(label.Label), nil)
-       lhs.Sym = types.Dclstack
+       lhs.Sym = types.Dclstack // context, for goto restriction
 
        var ls *Node
        if label.Stmt != nil { // TODO(mdempsky): Should always be present.
index dfb63e9352f91378a1e137195d775edb71f53ea9..9ee3f796f74ca7e901c03b0a305d8bdbf2d7d494 100644 (file)
@@ -46,10 +46,9 @@ func push(pos src.XPos) *Sym {
 
 // Pushdcl pushes the current declaration for symbol s (if any) so that
 // it can be shadowed by a new declaration within a nested block scope.
-func Pushdcl(s *Sym, pos src.XPos) *Sym {
+func Pushdcl(s *Sym, pos src.XPos) {
        d := push(pos)
        dcopy(d, s)
-       return d
 }
 
 // Popdcl pops the innermost block scope and restores all symbol declarations