summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-03-12 19:57:30 -0700
committerRuss Cox <rsc@golang.org>2009-03-12 19:57:30 -0700
commit2a4eb4e39ff6fbe732b3867f6bcd537e23d3913c (patch)
treea8d9c360eef306e8574009e6f38363f34862d581
parent3843aba02e52c8dfb98a7222a28b83188874afff (diff)
downloadgolang-2a4eb4e39ff6fbe732b3867f6bcd537e23d3913c.tar.gz
warn -> yyerror in mparith.
close two more bugs. R=ken OCL=26226 CL=26226
-rw-r--r--src/cmd/gc/go.y8
-rw-r--r--src/cmd/gc/mparith1.c4
-rw-r--r--src/cmd/gc/mparith2.c34
-rw-r--r--src/cmd/gc/mparith3.c6
-rw-r--r--test/fixedbugs/bug108.go (renamed from test/bugs/bug108.go)2
-rw-r--r--test/fixedbugs/bug125.go (renamed from test/bugs/bug125.go)2
-rw-r--r--test/golden.out7
7 files changed, 25 insertions, 38 deletions
diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y
index bbffa34bb..fd347177f 100644
--- a/src/cmd/gc/go.y
+++ b/src/cmd/gc/go.y
@@ -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
diff --git a/src/cmd/gc/mparith1.c b/src/cmd/gc/mparith1.c
index c4dbf9f08..8bf713152 100644
--- a/src/cmd/gc/mparith1.c
+++ b/src/cmd/gc/mparith1.c
@@ -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);
}
diff --git a/src/cmd/gc/mparith2.c b/src/cmd/gc/mparith2.c
index 2765ff5c2..9be8a16b7 100644
--- a/src/cmd/gc/mparith2.c
+++ b/src/cmd/gc/mparith2.c
@@ -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;
}
diff --git a/src/cmd/gc/mparith3.c b/src/cmd/gc/mparith3.c
index 8e3da7a4b..f97d0b829 100644
--- a/src/cmd/gc/mparith3.c
+++ b/src/cmd/gc/mparith3.c
@@ -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);
}
diff --git a/test/bugs/bug108.go b/test/fixedbugs/bug108.go
index b7350e72c..5c7649f08 100644
--- a/test/bugs/bug108.go
+++ b/test/fixedbugs/bug108.go
@@ -6,5 +6,5 @@
package main
func f() {
- v := 1 << 1025; // ERROR "overflow"
+ v := 1 << 1025; // ERROR "overflow|stupid shift"
}
diff --git a/test/bugs/bug125.go b/test/fixedbugs/bug125.go
index c8c5f7dfa..5670ce028 100644
--- a/test/bugs/bug125.go
+++ b/test/fixedbugs/bug125.go
@@ -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() {
diff --git a/test/golden.out b/test/golden.out
index c91bb450f..31ca675c1 100644
--- a/test/golden.out
+++ b/test/golden.out
@@ -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