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
0aa1b150
Commit
0aa1b150
authored
Jul 06, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shift typechecking bugs
x << "a" 1 << int(2) R=ken OCL=31244 CL=31244
parent
908cd8f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
src/cmd/gc/const.c
src/cmd/gc/const.c
+11
-4
src/cmd/gc/walk.c
src/cmd/gc/walk.c
+1
-1
No files found.
src/cmd/gc/const.c
View file @
0aa1b150
...
...
@@ -345,6 +345,8 @@ evconst(Node *n)
// right must be unsigned.
// left can be ideal.
defaultlit
(
nr
,
types
[
TUINT
]);
if
(
nr
->
type
&&
(
issigned
[
nr
->
type
->
etype
]
||
!
isint
[
nr
->
type
->
etype
]))
goto
illegal
;
break
;
}
...
...
@@ -367,9 +369,11 @@ evconst(Node *n)
switch
(
TUP
(
n
->
op
,
v
.
ctype
))
{
default:
illegal:
yyerror
(
"illegal constant expression %T %O %T"
,
nl
->
type
,
n
->
op
,
nr
->
type
);
n
->
diag
=
1
;
if
(
!
n
->
diag
)
{
yyerror
(
"illegal constant expression: %T %O %T"
,
nl
->
type
,
n
->
op
,
nr
->
type
);
n
->
diag
=
1
;
}
return
;
case
TUP
(
OADD
,
CTINT
):
...
...
@@ -551,7 +555,10 @@ unary:
switch
(
TUP
(
n
->
op
,
v
.
ctype
))
{
default:
yyerror
(
"illegal constant expression %O %T"
,
n
->
op
,
nl
->
type
);
if
(
!
n
->
diag
)
{
yyerror
(
"illegal constant expression %O %T"
,
n
->
op
,
nl
->
type
);
n
->
diag
=
1
;
}
return
;
case
TUP
(
OPLUS
,
CTINT
):
...
...
src/cmd/gc/walk.c
View file @
0aa1b150
...
...
@@ -704,7 +704,7 @@ loop:
defaultlit
(
n
->
right
,
types
[
TUINT
]);
if
(
n
->
left
->
type
==
T
||
n
->
right
->
type
==
T
)
goto
ret
;
if
(
issigned
[
n
->
right
->
type
->
etype
])
if
(
issigned
[
n
->
right
->
type
->
etype
]
||
!
isint
[
n
->
right
->
type
->
etype
]
)
goto
badt
;
// check of n->left->type happens in second switch.
break
;
...
...
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