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
ac9d833c
Commit
ac9d833c
authored
Aug 24, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
half of bug193
R=ken OCL=33730 CL=33730
parent
fd6cdbd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
const.c
src/cmd/gc/const.c
+12
-2
typecheck.c
src/cmd/gc/typecheck.c
+5
-0
golden.out
test/golden.out
+1
-3
No files found.
src/cmd/gc/const.c
View file @
ac9d833c
...
...
@@ -100,7 +100,12 @@ convlit1(Node **np, Type *t, int explicit)
case
OLSH
:
case
ORSH
:
convlit
(
&
n
->
left
,
t
);
n
->
type
=
n
->
left
->
type
;
t
=
n
->
left
->
type
;
if
(
t
!=
T
&&
!
isint
[
t
->
etype
])
{
yyerror
(
"invalid operation: %#N (shift of type %T)"
,
n
,
t
);
t
=
T
;
}
n
->
type
=
t
;
return
;
}
// avoided repeated calculations, errors
...
...
@@ -728,7 +733,12 @@ defaultlit(Node **np, Type *t)
case
OLSH
:
case
ORSH
:
defaultlit
(
&
n
->
left
,
t
);
n
->
type
=
n
->
left
->
type
;
t
=
n
->
left
->
type
;
if
(
t
!=
T
&&
!
isint
[
t
->
etype
])
{
yyerror
(
"invalid operation: %#N (shift of type %T)"
,
n
,
t
);
t
=
T
;
}
n
->
type
=
t
;
return
;
default:
defaultlit
(
&
n
->
left
,
t
);
...
...
src/cmd/gc/typecheck.c
View file @
ac9d833c
...
...
@@ -335,6 +335,11 @@ reswitch:
yyerror
(
"invalid operation: %#N (shift count type %T)"
,
n
,
r
->
type
);
goto
error
;
}
t
=
l
->
type
;
if
(
t
!=
T
&&
t
->
etype
!=
TIDEAL
&&
!
isint
[
t
->
etype
])
{
yyerror
(
"invalid operation: %#N (shift of type %T)"
,
n
,
t
);
goto
error
;
}
// no defaultlit for left
// the outer context gives the type
n
->
type
=
l
->
type
;
...
...
test/golden.out
View file @
ac9d833c
...
...
@@ -170,9 +170,7 @@ bugs/bug190.go:15: invalid recursive type func(S) (S)
BUG: should compile
=========== bugs/bug193.go
BUG: errchk: bugs/bug193.go:13: error message does not match 'shift'
bugs/bug193.go:13: fatal error: optoas: no entry LSH-float
errchk: bugs/bug193.go:14: missing expected error: 'shift'
BUG: errchk: bugs/bug193.go:14: missing expected error: 'shift'
=========== bugs/bug194.go
bugs/bug194.go:15: array index must be non-negative integer constant
...
...
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