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
1926fef1
Commit
1926fef1
authored
Jun 18, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bogus diagnostic with
default as first case in a switch SVN=123398
parent
c242b53d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
gen.c
src/cmd/6g/gen.c
+1
-2
walk.c
src/cmd/gc/walk.c
+4
-5
No files found.
src/cmd/6g/gen.c
View file @
1926fef1
...
...
@@ -440,7 +440,7 @@ swgen(Node *n)
while
(
c1
!=
N
)
{
dynlineno
=
c1
->
lineno
;
// for diagnostics
if
(
c1
->
op
!=
OCASE
)
{
if
(
s0
==
C
)
if
(
s0
==
C
&&
dflt
==
P
)
yyerror
(
"unreachable statements in a switch"
);
gen
(
c1
);
...
...
@@ -463,7 +463,6 @@ swgen(Node *n)
dflt
=
pc
;
while
(
c2
!=
N
)
{
s
=
mal
(
sizeof
(
*
s
));
if
(
s0
==
C
)
s0
=
s
;
...
...
src/cmd/gc/walk.c
View file @
1926fef1
...
...
@@ -116,6 +116,7 @@ loop:
walktype
(
n
->
ninit
,
Etop
);
walktype
(
n
->
ntest
,
Erv
);
walktype
(
n
->
nbody
,
Etop
);
// find common type
if
(
n
->
ntest
->
type
==
T
)
n
->
ntest
->
type
=
walkswitch
(
n
,
sw1
);
...
...
@@ -127,11 +128,9 @@ loop:
// set the type on all literals
if
(
n
->
ntest
->
type
!=
T
)
walkswitch
(
n
,
sw3
);
walktype
(
n
->
ntest
,
Erv
);
n
=
n
->
nincr
;
goto
loop
;
walktype
(
n
->
ntest
,
Erv
);
// BOTCH is this right
walktype
(
n
->
nincr
,
Erv
);
goto
ret
;
case
OEMPTY
:
if
(
top
!=
Etop
)
...
...
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