]> Cypherpunks repositories - gostls13.git/commitdiff
bug 156
authorKen Thompson <ken@golang.org>
Fri, 29 May 2009 22:34:47 +0000 (15:34 -0700)
committerKen Thompson <ken@golang.org>
Fri, 29 May 2009 22:34:47 +0000 (15:34 -0700)
R=r
OCL=29623
CL=29623

src/cmd/gc/const.c
test/fixedbugs/bug156.go [moved from test/bugs/bug156.go with 100% similarity]
test/golden.out

index 147af4fe39b68489e77de9bf7432b812c8b7684c..98245fbc4e785396f5db7cf6175a55e95decd3c2 100644 (file)
@@ -568,22 +568,17 @@ unary:
                // result will be (a ^ mask)
                switch(et) {
                default:
+                       // signed guys change sign
                        mpmovecfix(&b, -1);
                        break;
 
-               case TINT8:
-               case TINT16:
-               case TINT32:
-               case TINT64:
-               case TINT:
-                       et++;           // convert to unsigned
-                                       // fallthrough
                case TUINT8:
                case TUINT16:
                case TUINT32:
                case TUINT64:
                case TUINT:
                case TUINTPTR:
+                       // unsigned guys invert their bits
                        mpmovefixfix(&b, maxintval[et]);
                        break;
                }
similarity index 100%
rename from test/bugs/bug156.go
rename to test/fixedbugs/bug156.go
index 46b4fb220998748cd36d1afa15d267e876b1d028..b5dbddffe62148ed9bdc8144bd8d87d63cbc7e5f 100644 (file)
@@ -104,10 +104,6 @@ BUG should compile
 5 7
 BUG: should crash
 
-=========== bugs/bug156.go
-bugs/bug156.go:7: constant 18446744073709551615 overflows int64
-BUG: bug156
-
 =========== fixedbugs/bug016.go
 fixedbugs/bug016.go:7: constant -3 overflows uint