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
603f9fee
Commit
603f9fee
authored
Dec 13, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: another shift bug
Fixes #1316. R=ken2 CC=golang-dev
https://golang.org/cl/3575042
parent
9da73612
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
src/cmd/gc/const.c
src/cmd/gc/const.c
+1
-1
test/const3.go
test/const3.go
+6
-0
No files found.
src/cmd/gc/const.c
View file @
603f9fee
...
@@ -101,7 +101,7 @@ convlit1(Node **np, Type *t, int explicit)
...
@@ -101,7 +101,7 @@ convlit1(Node **np, Type *t, int explicit)
break
;
break
;
case
OLSH
:
case
OLSH
:
case
ORSH
:
case
ORSH
:
convlit1
(
&
n
->
left
,
t
,
explicit
);
convlit1
(
&
n
->
left
,
t
,
explicit
&&
isideal
(
n
->
left
->
type
)
);
t
=
n
->
left
->
type
;
t
=
n
->
left
->
type
;
if
(
t
!=
T
&&
!
isint
[
t
->
etype
])
{
if
(
t
!=
T
&&
!
isint
[
t
->
etype
])
{
yyerror
(
"invalid operation: %#N (shift of type %T)"
,
n
,
t
);
yyerror
(
"invalid operation: %#N (shift of type %T)"
,
n
,
t
);
...
...
test/const3.go
View file @
603f9fee
...
@@ -26,4 +26,10 @@ func main() {
...
@@ -26,4 +26,10 @@ func main() {
println
(
"type info didn't propagate in const: got"
,
s
)
println
(
"type info didn't propagate in const: got"
,
s
)
panic
(
"fail"
)
panic
(
"fail"
)
}
}
x
:=
uint
(
5
)
y
:=
float64
(
uint64
(
1
)
<<
x
)
// used to fail to compile
if
y
!=
32
{
println
(
"wrong y"
,
y
)
panic
(
"fail"
)
}
}
}
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