mirror of
https://github.com/golang/go
synced 2024-11-12 03:00:22 -07:00
half of bug193
R=ken OCL=33730 CL=33730
This commit is contained in:
parent
fd6cdbd807
commit
ac9d833c1e
@ -100,7 +100,12 @@ convlit1(Node **np, Type *t, int explicit)
|
|||||||
case OLSH:
|
case OLSH:
|
||||||
case ORSH:
|
case ORSH:
|
||||||
convlit(&n->left, t);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
// avoided repeated calculations, errors
|
// avoided repeated calculations, errors
|
||||||
@ -728,7 +733,12 @@ defaultlit(Node **np, Type *t)
|
|||||||
case OLSH:
|
case OLSH:
|
||||||
case ORSH:
|
case ORSH:
|
||||||
defaultlit(&n->left, t);
|
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;
|
return;
|
||||||
default:
|
default:
|
||||||
defaultlit(&n->left, t);
|
defaultlit(&n->left, t);
|
||||||
|
@ -335,6 +335,11 @@ reswitch:
|
|||||||
yyerror("invalid operation: %#N (shift count type %T)", n, r->type);
|
yyerror("invalid operation: %#N (shift count type %T)", n, r->type);
|
||||||
goto error;
|
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
|
// no defaultlit for left
|
||||||
// the outer context gives the type
|
// the outer context gives the type
|
||||||
n->type = l->type;
|
n->type = l->type;
|
||||||
|
@ -170,9 +170,7 @@ bugs/bug190.go:15: invalid recursive type func(S) (S)
|
|||||||
BUG: should compile
|
BUG: should compile
|
||||||
|
|
||||||
=========== bugs/bug193.go
|
=========== bugs/bug193.go
|
||||||
BUG: errchk: bugs/bug193.go:13: error message does not match 'shift'
|
BUG: errchk: bugs/bug193.go:14: missing expected error: 'shift'
|
||||||
bugs/bug193.go:13: fatal error: optoas: no entry LSH-float
|
|
||||||
errchk: bugs/bug193.go:14: missing expected error: 'shift'
|
|
||||||
|
|
||||||
=========== bugs/bug194.go
|
=========== bugs/bug194.go
|
||||||
bugs/bug194.go:15: array index must be non-negative integer constant
|
bugs/bug194.go:15: array index must be non-negative integer constant
|
||||||
|
Loading…
Reference in New Issue
Block a user