Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
ac9d833c
Commit
ac9d833c
authored
Aug 23, 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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
src/cmd/gc/const.c
src/cmd/gc/const.c
+12
-2
src/cmd/gc/typecheck.c
src/cmd/gc/typecheck.c
+5
-0
test/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