aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2016-03-02 17:40:18 -0800
committerRobert Griesemer <gri@golang.org>2016-03-03 04:07:32 +0000
commit533f30b924ce150eddf0bea6746bc88631e4dde8 (patch)
tree8b5bffd4277f5ff6197482a8eb74356631a58e80 /src
parentc41608f4ac868047dcab0de73cb96e831db264be (diff)
downloadgo-533f30b924ce150eddf0bea6746bc88631e4dde8.tar.xz
cmd/compile: exit early if oldname doesn't find a name
Change-Id: I59ce1b40bc3472cc92a9a0a9fbd32342e0b945ad Reviewed-on: https://go-review.googlesource.com/20152 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/gc/dcl.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/gc/dcl.go b/src/cmd/compile/internal/gc/dcl.go
index 893fb6bf69..11ce49f369 100644
--- a/src/cmd/compile/internal/gc/dcl.go
+++ b/src/cmd/compile/internal/gc/dcl.go
@@ -388,6 +388,7 @@ func oldname(s *Sym) *Node {
n = newname(s)
n.Op = ONONAME
n.Name.Iota = iota_ // save current iota value in const declarations
+ return n
}
if Curfn != nil && n.Op == ONAME && n.Name.Funcdepth > 0 && n.Name.Funcdepth != Funcdepth {