mirror of
https://github.com/golang/go
synced 2024-11-22 01:14:40 -07:00
bug 155
R=r OCL=29619 CL=29619
This commit is contained in:
parent
cc7c31baa4
commit
1c7bee0567
@ -557,13 +557,15 @@ cgen_shift(int op, Node *nl, Node *nr, Node *res)
|
||||
Node n1, n2, n3;
|
||||
int a;
|
||||
Prog *p1;
|
||||
uvlong sc;
|
||||
|
||||
a = optoas(op, nl->type);
|
||||
|
||||
if(nr->op == OLITERAL) {
|
||||
regalloc(&n1, nl->type, res);
|
||||
cgen(nl, &n1);
|
||||
if(mpgetfix(nr->val.u.xval) >= nl->type->width*8) {
|
||||
sc = mpgetfix(nr->val.u.xval);
|
||||
if(sc >= nl->type->width*8) {
|
||||
// large shift gets 2 shifts by width
|
||||
nodconst(&n3, types[TUINT32], nl->type->width*8-1);
|
||||
gins(a, &n3, &n1);
|
||||
|
@ -104,12 +104,6 @@ BUG should compile
|
||||
5 7
|
||||
BUG: should crash
|
||||
|
||||
=========== bugs/bug155.go
|
||||
main·f: doasm: notfound from=75 to=13 (82) SHLQ $-9223372036854775808,BX
|
||||
main·f: doasm: notfound from=75 to=13 (82) SHLQ $-9223372036854775808,BX
|
||||
main·f: doasm: notfound from=75 to=13 (82) SHLQ $-9223372036854775808,BX
|
||||
BUG: bug155
|
||||
|
||||
=========== bugs/bug156.go
|
||||
bugs/bug156.go:7: constant 18446744073709551615 overflows int64
|
||||
BUG: bug156
|
||||
|
Loading…
Reference in New Issue
Block a user