Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
5600435f
Commit
5600435f
authored
Aug 20, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
produce diagnostic for
import "fmt" var fmt = 1 R=ken OCL=33556 CL=33561
parent
0a162a14
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
18 deletions
+20
-18
align.c
src/cmd/gc/align.c
+7
-0
go.h
src/cmd/gc/go.h
+1
-0
go.y
src/cmd/gc/go.y
+1
-9
lex.c
src/cmd/gc/lex.c
+1
-0
subr.c
src/cmd/gc/subr.c
+1
-0
godoc.go
src/cmd/godoc/godoc.go
+3
-3
golden.out
test/golden.out
+6
-6
No files found.
src/cmd/gc/align.c
View file @
5600435f
...
...
@@ -97,6 +97,7 @@ dowidth(Type *t)
{
int32
et
;
uint32
w
;
int
lno
;
if
(
maxround
==
0
||
widthptr
==
0
)
fatal
(
"dowidth without betypeinit"
);
...
...
@@ -108,11 +109,16 @@ dowidth(Type *t)
return
;
if
(
t
->
width
==
-
2
)
{
lno
=
lineno
;
lineno
=
t
->
lineno
;
yyerror
(
"invalid recursive type %T"
,
t
);
t
->
width
=
0
;
lineno
=
lno
;
return
;
}
lno
=
lineno
;
lineno
=
t
->
lineno
;
t
->
width
=
-
2
;
et
=
t
->
etype
;
...
...
@@ -218,6 +224,7 @@ dowidth(Type *t)
}
t
->
width
=
w
;
lineno
=
lno
;
}
void
...
...
src/cmd/gc/go.h
View file @
5600435f
...
...
@@ -143,6 +143,7 @@ struct Type
uchar
deferwidth
;
Node
*
nod
;
// canonical OTYPE node
int
lineno
;
// TFUNCT
uchar
thistuple
;
...
...
src/cmd/gc/go.y
View file @
5600435f
...
...
@@ -177,14 +177,6 @@ import_stmt:
break;
}
// In order to allow multifile packages to use type names
// that are the same as the package name (i.e. go/parser
// is package parser and has a type called parser), we have
// to not bother trying to declare the package if it is our package.
// TODO(rsc): Is there a better way to tell if the package is ours?
if(my == import && strcmp(import->name, package) == 0)
break;
// TODO(rsc): this line is needed for a package
// which does bytes := in a function, which creates
// an ONONAME for bytes, but then a different file
...
...
@@ -197,7 +189,7 @@ import_stmt:
my->def = nod(OPACK, N, N);
my->def->sym = import;
my->lastlineno = $1;
import->block =
-1; // above
top level
import->block =
1; // at
top level
}
...
...
src/cmd/gc/lex.c
View file @
5600435f
...
...
@@ -447,6 +447,7 @@ l0:
switch
(
c
)
{
case
EOF
:
lineno
=
prevlineno
;
ungetc
(
EOF
);
return
-
1
;
...
...
src/cmd/gc/subr.c
View file @
5600435f
...
...
@@ -392,6 +392,7 @@ typ(int et)
t
=
mal
(
sizeof
(
*
t
));
t
->
etype
=
et
;
t
->
width
=
BADWIDTH
;
t
->
lineno
=
lineno
;
return
t
;
}
...
...
src/cmd/godoc/godoc.go
View file @
5600435f
...
...
@@ -567,7 +567,7 @@ func exec(c *http.Conn, args []string) bool {
}
func
sync
(
c
*
http
.
Conn
,
r
*
http
.
Request
)
{
func
do
sync
(
c
*
http
.
Conn
,
r
*
http
.
Request
)
{
args
:=
[]
string
{
"/bin/sh"
,
"-c"
,
*
syncCmd
};
if
!
exec
(
c
,
args
)
{
*
syncMin
=
0
;
// disable sync
...
...
@@ -622,7 +622,7 @@ func main() {
http
.
Handle
(
Pkg
,
http
.
HandlerFunc
(
servePkg
));
if
*
syncCmd
!=
""
{
http
.
Handle
(
"/debug/sync"
,
http
.
HandlerFunc
(
sync
));
http
.
Handle
(
"/debug/sync"
,
http
.
HandlerFunc
(
do
sync
));
}
http
.
Handle
(
"/"
,
http
.
HandlerFunc
(
serveFile
));
...
...
@@ -638,7 +638,7 @@ func main() {
log
.
Stderrf
(
"sync every %dmin"
,
*
syncMin
);
}
for
*
syncMin
>
0
{
sync
(
nil
,
nil
);
do
sync
(
nil
,
nil
);
time
.
Sleep
(
int64
(
*
syncMin
)
*
(
60
*
1e9
));
}
if
*
verbose
{
...
...
test/golden.out
View file @
5600435f
...
...
@@ -161,10 +161,10 @@ BUG: 0 1
BUG: errchk: command succeeded unexpectedly
=========== bugs/bug190.go
<epoch>
: invalid recursive type []S
<epoch>
: invalid recursive type S
<epoch>
: invalid recursive type S
<epoch>
: invalid recursive type chan S
<epoch>
: invalid recursive type S
<epoch>
: invalid recursive type func(S) (S)
bugs/bug190.go:11
: invalid recursive type []S
bugs/bug190.go:16
: invalid recursive type S
bugs/bug190.go:16
: invalid recursive type S
bugs/bug190.go:13
: invalid recursive type chan S
bugs/bug190.go:16
: invalid recursive type S
bugs/bug190.go:15
: invalid recursive type func(S) (S)
BUG: should compile
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