Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
5fbadf0b
Commit
5fbadf0b
authored
Mar 12, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
warn -> yyerror in mparith.
close two more bugs. R=ken OCL=26226 CL=26226
parent
f8ba0f45
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
38 deletions
+25
-38
src/cmd/gc/go.y
src/cmd/gc/go.y
+1
-7
src/cmd/gc/mparith1.c
src/cmd/gc/mparith1.c
+2
-2
src/cmd/gc/mparith2.c
src/cmd/gc/mparith2.c
+17
-17
src/cmd/gc/mparith3.c
src/cmd/gc/mparith3.c
+3
-3
test/fixedbugs/bug108.go
test/fixedbugs/bug108.go
+1
-1
test/fixedbugs/bug125.go
test/fixedbugs/bug125.go
+1
-1
test/golden.out
test/golden.out
+0
-7
No files found.
src/cmd/gc/go.y
View file @
5fbadf0b
...
...
@@ -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
...
...
src/cmd/gc/mparith1.c
View file @
5fbadf0b
...
...
@@ -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
);
}
...
...
src/cmd/gc/mparith2.c
View file @
5fbadf0b
...
...
@@ -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
;
}
...
...
src/cmd/gc/mparith3.c
View file @
5fbadf0b
...
...
@@ -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
);
}
...
...
test/bugs/bug108.go
→
test/
fixed
bugs/bug108.go
View file @
5fbadf0b
...
...
@@ -6,5 +6,5 @@
package
main
func
f
()
{
v
:=
1
<<
1025
;
// ERROR "overflow"
v
:=
1
<<
1025
;
// ERROR "overflow
|stupid shift
"
}
test/bugs/bug125.go
→
test/
fixed
bugs/bug125.go
View file @
5fbadf0b
...
...
@@ -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
()
{
...
...
test/golden.out
View file @
5fbadf0b
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment