Skip to content

Commit 7c5a9fc

Browse files
authored
Merge pull request #25 from golang/master
[pull] master from golang:master
2 parents d40a99f + ce4fc94 commit 7c5a9fc

6 files changed

Lines changed: 53 additions & 4 deletions

File tree

src/cmd/compile/internal/ir/func.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"cmd/internal/src"
1414
"encoding/base64"
1515
"fmt"
16-
"io"
1716
"unicode/utf8"
1817
)
1918

@@ -472,9 +471,11 @@ func closureName(outerfn *Func, pos src.XPos, why Op, gen int) *types.Sym {
472471
// we use a content hash to disambiguate instead.
473472
// We choose the suffix as a hash of the inline call stack.
474473
h := hash.New32()
475-
io.WriteString(h, outer)
474+
fmt.Fprint(h, inlIndex)
476475
base.Ctxt.InlTree.AllParents(inlIndex, func(call obj.InlinedCall) {
477-
io.WriteString(h, call.Name+":"+call.Pos.LineNumber()+":"+call.Pos.ColumnNumber())
476+
if call.Parent >= 0 {
477+
fmt.Fprint(h, " ", call.Parent)
478+
}
478479
})
479480
inlHash = base64.StdEncoding.EncodeToString(h.Sum(nil)[:8])
480481

src/cmd/internal/obj/plist.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ func (ctxt *Link) InitTextSym(s *LSym, flag int, start src.XPos) {
183183
return
184184
}
185185
if s.Func() != nil {
186-
ctxt.Diag("%s: symbol %s redeclared\n\t%s: other declaration of symbol %s", ctxt.PosTable.Pos(start), s.Name, ctxt.PosTable.Pos(s.Func().Text.Pos), s.Name)
186+
otherPos := src.NoPos
187+
if s.Func().Text != nil {
188+
otherPos = ctxt.PosTable.Pos(s.Func().Text.Pos)
189+
}
190+
ctxt.Diag("%s: symbol %s redeclared\n\t%s: other declaration of symbol %s", ctxt.PosTable.Pos(start), s.Name, otherPos, s.Name)
187191
return
188192
}
189193
s.NewFuncInfo()

test/fixedbugs/issue79274.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// compile
2+
3+
// Copyright 2026 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
package main
8+
9+
import "math/big"
10+
11+
func F() {
12+
var pg0_0 *int
13+
_ = pg0_0
14+
var u16_0 uint16
15+
fnc := func(a [0][][3]int, b [14][9]uint16, c []big.Int) uint16 {
16+
pg0_0 = func() *int { return nil }()
17+
return 0
18+
}
19+
20+
fnc([0][][3]int{}, [14][9]uint16{[9]uint16{fnc([0][][3]int{}, [14][9]uint16{[9]uint16{min(fnc([0][][3]int{}, [14][9]uint16{[9]uint16{(uint16)(16), (uint16)(93), (uint16)(31)}, [9]uint16{(uint16)(5), (uint16)(69)}, [9]uint16{}}, []big.Int{}), u16_0), fnc([0][][3]int{}, [14][9]uint16{}, nil)}, [9]uint16{fnc([0][][3]int{}, [14][9]uint16{}, nil)}, [9]uint16{}}, nil), 0}}, nil)
21+
}
22+
23+
func main() {
24+
F()
25+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright 2026 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package p
6+
var _ = F(); func F() func() { return func() {} }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright 2026 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package p
6+
var _ = F()

test/fixedbugs/issue79274a.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// compiledir
2+
3+
// Copyright 2026 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
package ignored

0 commit comments

Comments
 (0)