From: Robert Griesemer Date: Fri, 7 Apr 2017 17:53:40 +0000 (-0700) Subject: cmd/compile/internal/types: don't return *Sym from Pushdcl (it's never used) X-Git-Tag: go1.9beta1~788 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=dc243f257bc5b9aff59782abae35a2868d593947;p=gostls13.git cmd/compile/internal/types: don't return *Sym from Pushdcl (it's never used) Change-Id: Ib55f7ea3f7dcd9d02f6027121663870a65cb886c Reviewed-on: https://go-review.googlesource.com/39924 Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go index 1ad19df7df..3d6eaf6e81 100644 --- a/src/cmd/compile/internal/gc/noder.go +++ b/src/cmd/compile/internal/gc/noder.go @@ -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. diff --git a/src/cmd/compile/internal/types/scope.go b/src/cmd/compile/internal/types/scope.go index dfb63e9352..9ee3f796f7 100644 --- a/src/cmd/compile/internal/types/scope.go +++ b/src/cmd/compile/internal/types/scope.go @@ -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