Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/goPublic

Commitb9b37d1

Browse files
committed
[release-branch.go1.1] cmd/gc: repair make(T) in export data for inlining.
««« CL 9303050 / 9a73efa2cd4ecmd/gc: repair make(T) in export data for inlining.When T was an unexported type it could be forgotten.Fixes#5470.R=golang-dev, bradfitzCC=golang-devhttps://golang.org/cl/9303050»»»R=bradfitz, iant, remyoudomphengCC=golang-devhttps://golang.org/cl/10029043
1 parent03290b5 commitb9b37d1

File tree

4 files changed

+54
-1
lines changed

4 files changed

+54
-1
lines changed

‎src/cmd/gc/export.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,15 @@ reexportdep(Node *n)
165165
caseODOTTYPE2:
166166
caseOSTRUCTLIT:
167167
caseOPTRLIT:
168+
caseOMAKEMAP:
169+
caseOMAKESLICE:
170+
caseOMAKECHAN:
168171
t=n->type;
169172
if(!t->sym&&t->type)
170173
t=t->type;
171174
if(t&&t->sym&&t->sym->def&& !exportedsym(t->sym)) {
172175
if(debug['E'])
173-
print("reexport type forconvnop %S\n",t->sym);
176+
print("reexport type forexpression %S\n",t->sym);
174177
exportlist=list(exportlist,t->sym->def);
175178
}
176179
break;

‎test/fixedbugs/issue5470.dir/a.go‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2013 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 a
6+
7+
typeFoointerface {
8+
Hi()string
9+
}
10+
11+
funcTest1()Foo {returnmake(tst1) }
12+
13+
typetst1map[string]bool
14+
15+
func (rtst1)Hi()string {return"Hi!" }
16+
17+
funcTest2()Foo {returnmake(tst2,0) }
18+
19+
typetst2 []string
20+
21+
func (rtst2)Hi()string {return"Hi!" }
22+
23+
funcTest3()Foo {returnmake(tst3) }
24+
25+
typetst3chanstring
26+
27+
func (rtst3)Hi()string {return"Hi!" }

‎test/fixedbugs/issue5470.dir/b.go‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2013 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 b
6+
7+
import"./a"
8+
9+
funcmain() {
10+
a.Test1()
11+
a.Test2()
12+
a.Test3()
13+
}

‎test/fixedbugs/issue5470.go‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// compiledir
2+
3+
// Copyright 2013 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+
// Issue 5470: exported data for inlining may miss
8+
// the type argument of make.
9+
10+
package ignored

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp