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
d3d0c256
Commit
d3d0c256
authored
Feb 17, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug123
R=ken OCL=25075 CL=25075
parent
aa35aee0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
lex.c
src/cmd/gc/lex.c
+3
-0
walk.c
src/cmd/gc/walk.c
+6
-1
bug123.go
test/fixedbugs/bug123.go
+1
-1
golden.out
test/golden.out
+0
-3
No files found.
src/cmd/gc/lex.c
View file @
d3d0c256
...
...
@@ -1233,6 +1233,9 @@ lexinit(void)
s
->
otype
=
t
;
}
/* for walk to use in error messages */
types
[
TFUNC
]
=
functype
(
N
,
N
,
N
);
/* pick up the backend typedefs */
belexinit
(
LBASETYPE
);
...
...
src/cmd/gc/walk.c
View file @
d3d0c256
...
...
@@ -373,9 +373,12 @@ loop:
if
(
n
->
type
!=
T
)
goto
ret
;
walktype
(
n
->
left
,
Erv
);
if
(
n
->
left
==
N
)
goto
ret
;
walktype
(
n
->
left
,
Erv
);
convlit
(
n
->
left
,
types
[
TFUNC
]);
t
=
n
->
left
->
type
;
if
(
t
==
T
)
goto
ret
;
...
...
@@ -472,6 +475,7 @@ loop:
if
(
cr
==
1
)
{
// a,b,... = fn()
walktype
(
r
,
Erv
);
convlit
(
r
,
types
[
TFUNC
]);
l
=
ascompatet
(
n
->
op
,
&
n
->
left
,
&
r
->
type
,
0
);
if
(
l
!=
N
)
indir
(
n
,
list
(
r
,
reorder2
(
l
)));
...
...
@@ -3108,6 +3112,7 @@ multi:
case
OCALLINTER
:
case
OCALL
:
walktype
(
nr
->
left
,
Erv
);
convlit
(
nr
->
left
,
types
[
TFUNC
]);
t
=
nr
->
left
->
type
;
if
(
t
!=
T
&&
t
->
etype
==
tptr
)
t
=
t
->
type
;
...
...
test/bugs/bug123.go
→
test/
fixed
bugs/bug123.go
View file @
d3d0c256
...
...
@@ -7,7 +7,7 @@
package
main
const
(
F
=
1
)
func
fn
(
i
int
)
int
{
if
i
==
F
()
{
// ERROR "func
tion
"
if
i
==
F
()
{
// ERROR "func"
return
0
}
return
1
...
...
test/golden.out
View file @
d3d0c256
...
...
@@ -143,9 +143,6 @@ BUG: should compile
=========== bugs/bug122.go
BUG: compilation succeeds incorrectly
=========== bugs/bug123.go
BUG: errchk: command succeeded unexpectedly: 6g bugs/bug123.go
=========== bugs/bug125.go
BUG: errchk: command succeeded unexpectedly: 6g bugs/bug125.go
...
...
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