Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
go
Commits
ac9d833c
Commit
ac9d833c
authored
15 years ago
by
Russ Cox
Browse files
Options
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
);
...
...
This diff is collapsed.
Click to expand it.
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
;
...
...
This diff is collapsed.
Click to expand it.
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
...
...
This diff is collapsed.
Click to expand it.
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