]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: do not emit args_stackmap for func _
authorRuss Cox <rsc@golang.org>
Wed, 4 Nov 2015 20:54:41 +0000 (15:54 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 16 Nov 2015 20:38:52 +0000 (20:38 +0000)
Fixes #11699.

Change-Id: I01bf506d76260bcdf828bbde52791e328aa441a5
Reviewed-on: https://go-review.googlesource.com/16921
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/compile/internal/gc/pgen.go
test/fixedbugs/issue11699.go [new file with mode: 0644]

index a40738375d90c045de6f94e496fdbfb5d76733cc..ea9b3687e121a0b70a1089d670c8be345a7721ce 100644 (file)
@@ -129,6 +129,9 @@ func gcsymdup(s *Sym) {
 }
 
 func emitptrargsmap() {
+       if Curfn.Func.Nname.Sym.Name == "_" {
+               return
+       }
        sym := Lookup(fmt.Sprintf("%s.args_stackmap", Curfn.Func.Nname.Sym.Name))
 
        nptr := int(Curfn.Type.Argwid / int64(Widthptr))
diff --git a/test/fixedbugs/issue11699.go b/test/fixedbugs/issue11699.go
new file mode 100644 (file)
index 0000000..965c87f
--- /dev/null
@@ -0,0 +1,12 @@
+// compile
+
+// Copyright 2015 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 11699; used to fail with duplicate _.args_stackmap symbols.
+
+package p
+
+func _()
+func _()