]> Cypherpunks repositories - gostls13.git/commitdiff
warn -> yyerror in mparith.
authorRuss Cox <rsc@golang.org>
Fri, 13 Mar 2009 02:57:30 +0000 (19:57 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 13 Mar 2009 02:57:30 +0000 (19:57 -0700)
close two more bugs.

R=ken
OCL=26226
CL=26226

src/cmd/gc/go.y
src/cmd/gc/mparith1.c
src/cmd/gc/mparith2.c
src/cmd/gc/mparith3.c
test/fixedbugs/bug108.go [moved from test/bugs/bug108.go with 80% similarity]
test/fixedbugs/bug125.go [moved from test/bugs/bug125.go with 89% similarity]
test/golden.out

index bbffa34bbe9764d139f49f8e85cad0342cefb19f..fd347177f2084825d76e394b7bd2414601cc2722 100644 (file)
@@ -215,12 +215,6 @@ xdcl:
                        autoexport($1->nname->sym);
                $$ = N;
        }
-|      LPACKAGE { warn("package is gone"); } xfndcl
-       {
-               if($3 != N && $3->nname != N)
-                       packagesym($3->nname->sym);
-               $$ = N;
-       }
 |      ';'
        {
                $$ = N;
@@ -1660,7 +1654,7 @@ exprsym3_list_r:
 
 import_stmt_list_r:
        import_stmt
-|      import_stmt_list_r osemi import_stmt
+|      import_stmt_list_r ';' import_stmt
 
 hidden_import_list_r:
 |      hidden_import_list_r hidden_import
index c4dbf9f0866357d41d69165fbb195ceaf6aba589..8bf71315208916a0b00c28655831f222f144f157 100644 (file)
@@ -308,7 +308,7 @@ out:
        return;
 
 bad:
-       warn("set ovf in mpatof");
+       yyerror("set ovf in mpatof");
        mpmovecflt(a, 0.0);
 }
 
@@ -396,7 +396,7 @@ out:
        return;
 
 bad:
-       warn("set ovf in mpatov: %s", as);
+       yyerror("set ovf in mpatov: %s", as);
        mpmovecfix(a, 0);
 }
 
index 2765ff5c2c4017f7337d3660e9bc9b6aa525a915..9be8a16b78850f1f87e0e235fbe5c3a9b37adf38 100644 (file)
@@ -119,7 +119,7 @@ mpcmp(Mpint *a, Mpint *b)
        int i;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in cmp");
+               yyerror("ovf in cmp");
                return 0;
        }
 
@@ -194,7 +194,7 @@ mpaddfixfix(Mpint *a, Mpint *b)
        long x, *a1, *b1;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in mpaddxx");
+               yyerror("ovf in mpaddxx");
                a->ovf = 1;
                return;
        }
@@ -217,7 +217,7 @@ mpaddfixfix(Mpint *a, Mpint *b)
        }
        a->ovf = c;
        if(a->ovf)
-               warn("set ovf in mpaddxx");
+               yyerror("set ovf in mpaddxx");
 
        return;
 
@@ -264,7 +264,7 @@ mpmulfixfix(Mpint *a, Mpint *b)
        Mpint s, q;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in mpmulfixfix");
+               yyerror("ovf in mpmulfixfix");
                a->ovf = 1;
                return;
        }
@@ -297,7 +297,7 @@ mpmulfixfix(Mpint *a, Mpint *b)
        q.neg = a->neg ^ b->neg;
        mpmovefixfix(a, &q);
        if(a->ovf)
-               warn("set ovf in mpmulfixfix");
+               yyerror("set ovf in mpmulfixfix");
 }
 
 void
@@ -309,7 +309,7 @@ mpmulfract(Mpint *a, Mpint *b)
        Mpint s, q;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in mpmulflt");
+               yyerror("ovf in mpmulflt");
                a->ovf = 1;
                return;
        }
@@ -336,7 +336,7 @@ mpmulfract(Mpint *a, Mpint *b)
        q.neg = a->neg ^ b->neg;
        mpmovefixfix(a, &q);
        if(a->ovf)
-               warn("set ovf in mpmulflt");
+               yyerror("set ovf in mpmulflt");
 }
 
 void
@@ -346,7 +346,7 @@ mporfixfix(Mpint *a, Mpint *b)
        long x, *a1, *b1;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in mporfixfix");
+               yyerror("ovf in mporfixfix");
                mpmovecfix(a, 0);
                a->ovf = 1;
                return;
@@ -380,7 +380,7 @@ mpandfixfix(Mpint *a, Mpint *b)
        long x, *a1, *b1;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in mpandfixfix");
+               yyerror("ovf in mpandfixfix");
                mpmovecfix(a, 0);
                a->ovf = 1;
                return;
@@ -414,7 +414,7 @@ mpandnotfixfix(Mpint *a, Mpint *b)
        long x, *a1, *b1;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in mpandnotfixfix");
+               yyerror("ovf in mpandnotfixfix");
                mpmovecfix(a, 0);
                a->ovf = 1;
                return;
@@ -448,7 +448,7 @@ mpxorfixfix(Mpint *a, Mpint *b)
        long x, *a1, *b1;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in mporfixfix");
+               yyerror("ovf in mporfixfix");
                mpmovecfix(a, 0);
                a->ovf = 1;
                return;
@@ -481,14 +481,14 @@ mplshfixfix(Mpint *a, Mpint *b)
        vlong s;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in mporfixfix");
+               yyerror("ovf in mporfixfix");
                mpmovecfix(a, 0);
                a->ovf = 1;
                return;
        }
        s = mpgetfix(b);
        if(s < 0 || s >= Mpprec*Mpscale) {
-               warn("stupid shift: %lld", s);
+               yyerror("stupid shift: %lld", s);
                mpmovecfix(a, 0);
                return;
        }
@@ -502,14 +502,14 @@ mprshfixfix(Mpint *a, Mpint *b)
        vlong s;
 
        if(a->ovf || b->ovf) {
-               warn("ovf in mprshfixfix");
+               yyerror("ovf in mprshfixfix");
                mpmovecfix(a, 0);
                a->ovf = 1;
                return;
        }
        s = mpgetfix(b);
        if(s < 0 || s >= Mpprec*Mpscale) {
-               warn("stupid shift: %lld", s);
+               yyerror("stupid shift: %lld", s);
                if(a->neg)
                        mpmovecfix(a, -1);
                else
@@ -532,7 +532,7 @@ mpgetfix(Mpint *a)
        vlong v;
 
        if(a->ovf) {
-               warn("ovf in mpgetfix");
+               yyerror("ovf in mpgetfix");
                return 0;
        }
 
@@ -588,7 +588,7 @@ mpdivmodfixfix(Mpint *q, Mpint *r, Mpint *n, Mpint *d)
        if(i >= Mpprec*Mpscale) {
                q->ovf = 1;
                r->ovf = 1;
-               warn("set ovf in mpdivmodfixfix");
+               yyerror("set ovf in mpdivmodfixfix");
                return;
        }
 
index 8e3da7a4b3a2ac359d18f4d2e59014971244befd..f97d0b829d6a39d1b1aba85af6399a1f150d6713 100644 (file)
@@ -134,7 +134,7 @@ mpdivfltflt(Mpflt *a, Mpflt *b)
                a->exp = 0;
                a->val.neg = 0;
                a->val.ovf = 1;
-               warn("mpdivfltflt divide by zero");
+               yyerror("mpdivfltflt divide by zero");
                return;
        }
        if(sa == 0) {
@@ -165,14 +165,14 @@ mpgetflt(Mpflt *a)
        double f;
 
        if(a->val.ovf)
-               warn("mpgetflt ovf");
+               yyerror("mpgetflt ovf");
 
        s = sigfig(a);
        if(s == 0)
                return 0;
 
        if(s != Mpnorm) {
-               warn("mpgetflt norm");
+               yyerror("mpgetflt norm");
                mpnorm(a);
        }
 
similarity index 80%
rename from test/bugs/bug108.go
rename to test/fixedbugs/bug108.go
index b7350e72cb2854a795f52da4d483ca28a12e5cb1..5c7649f0819d3baafb9d773f7b5345a3a4dca31a 100644 (file)
@@ -6,5 +6,5 @@
 
 package main
 func f() {
-       v := 1 << 1025;         // ERROR "overflow"
+       v := 1 << 1025;         // ERROR "overflow|stupid shift"
 }
similarity index 89%
rename from test/bugs/bug125.go
rename to test/fixedbugs/bug125.go
index c8c5f7dfa398343de660acfde72fe33fc9a86a07..5670ce028b7af361cf295bb9a71452ff630dc75a 100644 (file)
@@ -8,7 +8,7 @@ package main
 
 import (
        OS "os"  // should require semicolon here; this is no different from other decls
-       IO "io"  // ERROR "missing"
+       IO "io"  // ERROR "missing|syntax"
 )
 
 func main() {
index c91bb450f3135879f516dbb5d2280e1c0087f1b5..31ca675c13d3338493e7b111616391406067ab0d 100644 (file)
@@ -106,10 +106,6 @@ abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz
 =========== chan/nonblock.go
 PASS
 
-=========== bugs/bug108.go
-bugs/bug108.go:4: stupid shift: 1025
-BUG: errchk: command succeeded unexpectedly:  6g bugs/bug108.go
-
 =========== bugs/bug115.go
 bugs/bug115.go:8: constant -1 overflows uint
 BUG: bug115 should compile
@@ -120,9 +116,6 @@ bugs/bug117.go:9: illegal types for operand: RETURN
        int
 BUG: should compile
 
-=========== bugs/bug125.go
-BUG: errchk: command succeeded unexpectedly:  6g bugs/bug125.go
-
 =========== bugs/bug131.go
 bugs/bug131.go:7: cannot convert uint64 constant to int64
 bugs/bug131.go:7: illegal types for operand: AS