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
767845b6
Commit
767845b6
authored
Mar 12, 2009
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug 125
R=r OCL=26146 CL=26146
parent
48f6b516
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
walk.c
src/cmd/gc/walk.c
+18
-4
bug122.go
test/fixedbugs/bug122.go
+0
-0
golden.out
test/golden.out
+3
-3
No files found.
src/cmd/gc/walk.c
View file @
767845b6
...
...
@@ -2220,6 +2220,10 @@ mapop(Node *n, int top)
fatal
(
"mapop: unknown op %O"
,
n
->
op
);
case
OMAKE
:
cl
=
listcount
(
n
->
left
);
if
(
cl
>
1
)
yyerror
(
"too many arguments to make map"
);
if
(
top
!=
Erv
)
goto
nottop
;
...
...
@@ -2232,8 +2236,9 @@ mapop(Node *n, int top)
break
;
a
=
n
->
left
;
// hint
if
(
n
->
left
==
N
)
if
(
cl
!=
1
)
a
=
nodintconst
(
0
);
r
=
a
;
a
=
nodintconst
(
algtype
(
t
->
type
));
// val algorithm
r
=
list
(
a
,
r
);
...
...
@@ -2427,6 +2432,10 @@ chanop(Node *n, int top)
fatal
(
"chanop: unknown op %O"
,
n
->
op
);
case
OMAKE
:
cl
=
listcount
(
n
->
left
);
if
(
cl
>
1
)
yyerror
(
"too many arguments to make chan"
);
// newchan(elemsize int, elemalg int,
// hint int) (hmap *chan[any-1]);
...
...
@@ -2434,12 +2443,12 @@ chanop(Node *n, int top)
if
(
t
==
T
)
break
;
if
(
n
->
left
!=
N
)
{
a
=
nodintconst
(
0
);
if
(
cl
==
1
)
{
// async buf size
a
=
nod
(
OCONV
,
n
->
left
,
N
);
a
->
type
=
types
[
TINT
];
}
else
a
=
nodintconst
(
0
);
}
r
=
a
;
a
=
nodintconst
(
algtype
(
t
->
type
));
// elem algorithm
...
...
@@ -2602,6 +2611,7 @@ arrayop(Node *n, int top)
Type
*
t
,
*
tl
;
Node
*
on
;
Iter
save
;
int
cl
;
r
=
n
;
switch
(
n
->
op
)
{
...
...
@@ -2658,6 +2668,10 @@ arrayop(Node *n, int top)
return
n
;
case
OMAKE
:
cl
=
listcount
(
n
->
left
);
if
(
cl
>
2
)
yyerror
(
"too many arguments to make array"
);
// newarray(nel int, max int, width int) (ary []any)
t
=
fixarray
(
n
->
type
);
if
(
t
==
T
)
...
...
test/bugs/bug122.go
→
test/
fixed
bugs/bug122.go
View file @
767845b6
File moved
test/golden.out
View file @
767845b6
...
...
@@ -125,9 +125,6 @@ bugs/bug117.go:9: illegal types for operand: RETURN
int
BUG: should compile
=========== bugs/bug122.go
BUG: compilation succeeds incorrectly
=========== bugs/bug125.go
BUG: errchk: command succeeded unexpectedly: 6g bugs/bug125.go
...
...
@@ -268,6 +265,9 @@ fixedbugs/bug121.go:20: illegal types for operand: AS
I
*S
=========== fixedbugs/bug122.go
fixedbugs/bug122.go:6: too many arguments to make array
=========== fixedbugs/bug133.go
fixedbugs/bug133.dir/bug2.go:11: undefined DOT i on bug0.T
fixedbugs/bug133.dir/bug2.go:11: illegal types for operand: RETURN
...
...
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