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
be63b6dc
Commit
be63b6dc
authored
May 31, 2009
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug 158
R=r OCL=29646 CL=29646
parent
91395ae6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
swt.c
src/cmd/gc/swt.c
+11
-3
bug157.go
test/bugs/bug157.go
+2
-2
bug158.go
test/fixedbugs/bug158.go
+1
-1
golden.out
test/golden.out
+0
-4
No files found.
src/cmd/gc/swt.c
View file @
be63b6dc
...
...
@@ -33,6 +33,14 @@ struct Case
};
#define C ((Case*)nil)
Type
*
notideal
(
Type
*
t
)
{
if
(
t
!=
T
&&
t
->
etype
==
TIDEAL
)
return
T
;
return
t
;
}
void
dumpcase
(
Case
*
c0
)
{
...
...
@@ -254,8 +262,8 @@ sw0(Node *c, Type *place, int arg)
Type
*
sw1
(
Node
*
c
,
Type
*
place
,
int
arg
)
{
if
(
place
=
=
T
)
return
c
->
type
;
if
(
place
!
=
T
)
return
notideal
(
c
->
type
)
;
return
place
;
}
...
...
@@ -605,7 +613,7 @@ exprswitch(Node *sw)
* walk the cases as appropriate for switch type
*/
walkcases
(
sw
,
sw0
,
arg
);
t
=
sw
->
ntest
->
type
;
t
=
notideal
(
sw
->
ntest
->
type
)
;
if
(
t
==
T
)
t
=
walkcases
(
sw
,
sw1
,
arg
);
if
(
t
==
T
)
...
...
test/bugs/bug157.go
View file @
be63b6dc
...
...
@@ -27,6 +27,6 @@ func main() {
/*
bug15
5
.go:20: syntax error near default
bug15
5
.go:20: first switch statement must be a case
bug15
7
.go:20: syntax error near default
bug15
7
.go:20: first switch statement must be a case
*/
test/bugs/bug158.go
→
test/
fixed
bugs/bug158.go
View file @
be63b6dc
...
...
@@ -22,5 +22,5 @@ func main() {
/*
bug15
6
.go:14: fatal error: dowidth: unknown type: E-33
bug15
8
.go:14: fatal error: dowidth: unknown type: E-33
*/
test/golden.out
View file @
be63b6dc
...
...
@@ -109,10 +109,6 @@ bugs/bug157.go:20: syntax error near default
bugs/bug157.go:20: first switch statement must be a case
BUG: should compile
=========== bugs/bug158.go
bugs/bug158.go:14: fatal error: dowidth: unknown type: E-33
BUG: should compile
=========== fixedbugs/bug016.go
fixedbugs/bug016.go:7: constant -3 overflows uint
...
...
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