Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
3a1fdc65
Commit
3a1fdc65
authored
Apr 25, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: fix import width bug
Fixes #1705. R=ken2 CC=golang-dev
https://golang.org/cl/4443060
parent
883d68f8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
1 deletion
+43
-1
src/cmd/5g/cgen.c
src/cmd/5g/cgen.c
+2
-0
src/cmd/6g/cgen.c
src/cmd/6g/cgen.c
+2
-0
src/cmd/8g/cgen.c
src/cmd/8g/cgen.c
+2
-0
src/cmd/gc/dcl.c
src/cmd/gc/dcl.c
+4
-0
src/cmd/gc/walk.c
src/cmd/gc/walk.c
+3
-1
test/fixedbugs/bug335.dir/a.go
test/fixedbugs/bug335.dir/a.go
+9
-0
test/fixedbugs/bug335.dir/b.go
test/fixedbugs/bug335.dir/b.go
+11
-0
test/fixedbugs/bug335.go
test/fixedbugs/bug335.go
+10
-0
No files found.
src/cmd/5g/cgen.c
View file @
3a1fdc65
...
...
@@ -43,6 +43,8 @@ cgen(Node *n, Node *res)
}
if
(
isfat
(
n
->
type
))
{
if
(
n
->
type
->
width
<
0
)
fatal
(
"forgot to compute width for %T"
,
n
->
type
);
sgen
(
n
,
res
,
n
->
type
->
width
);
goto
ret
;
}
...
...
src/cmd/6g/cgen.c
View file @
3a1fdc65
...
...
@@ -47,6 +47,8 @@ cgen(Node *n, Node *res)
}
if
(
isfat
(
n
->
type
))
{
if
(
n
->
type
->
width
<
0
)
fatal
(
"forgot to compute width for %T"
,
n
->
type
);
sgen
(
n
,
res
,
n
->
type
->
width
);
goto
ret
;
}
...
...
src/cmd/8g/cgen.c
View file @
3a1fdc65
...
...
@@ -78,6 +78,8 @@ cgen(Node *n, Node *res)
// structs etc get handled specially
if
(
isfat
(
n
->
type
))
{
if
(
n
->
type
->
width
<
0
)
fatal
(
"forgot to compute width for %T"
,
n
->
type
);
sgen
(
n
,
res
,
n
->
type
->
width
);
return
;
}
...
...
src/cmd/gc/dcl.c
View file @
3a1fdc65
...
...
@@ -684,6 +684,10 @@ ok:
pt
->
nod
=
n
;
pt
->
sym
=
n
->
sym
;
pt
->
sym
->
lastlineno
=
parserline
();
pt
->
siggen
=
0
;
pt
->
printed
=
0
;
pt
->
deferwidth
=
0
;
pt
->
local
=
0
;
declare
(
n
,
PEXTERN
);
checkwidth
(
pt
);
...
...
src/cmd/gc/walk.c
View file @
3a1fdc65
...
...
@@ -142,7 +142,9 @@ walkdeftype(Node *n)
}
// copy new type and clear fields
// that don't come along
// that don't come along.
// anything zeroed here must be zeroed in
// typedcl2 too.
maplineno
=
n
->
type
->
maplineno
;
embedlineno
=
n
->
type
->
embedlineno
;
*
n
->
type
=
*
t
;
...
...
test/fixedbugs/bug335.dir/a.go
0 → 100644
View file @
3a1fdc65
// Copyright 2011 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.
package
a
import
"./b"
var
Bar
=
b
.
Foo
test/fixedbugs/bug335.dir/b.go
0 → 100644
View file @
3a1fdc65
// Copyright 2011 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.
package
b
type
T
interface
{}
func
f
()
T
{
return
nil
}
var
Foo
T
=
f
()
test/fixedbugs/bug335.go
0 → 100644
View file @
3a1fdc65
// $G $D/$F.dir/b.go && $G $D/$F.dir/a.go
// rm -f a.$A b.$A
// Copyright 2011 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 1705.
unused
(
see
script
at
top
of
file
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment