Commit d6f15be6 authored by Rob Pike's avatar Rob Pike

fixes for funcs without returns

R=ken
OCL=15170
CL=15170
parent ff65872f
...@@ -144,9 +144,7 @@ func (b *BoolValue) Str() string { ...@@ -144,9 +144,7 @@ func (b *BoolValue) Str() string {
if b.val { if b.val {
return "true" return "true"
} }
else {
return "false" return "false"
}
} }
func NewBoolValue(b bool, p *bool) *BoolValue { func NewBoolValue(b bool, p *bool) *BoolValue {
......
...@@ -49,4 +49,5 @@ hypot(p, q float64) float64 ...@@ -49,4 +49,5 @@ hypot(p, q float64) float64
q = q*r; q = q*r;
r = q/p; r = q/p;
} }
panic("unreachable")
} }
...@@ -62,4 +62,5 @@ pow(arg1,arg2 float64) float64 ...@@ -62,4 +62,5 @@ pow(arg1,arg2 float64) float64
} }
arg1 *= arg1; arg1 *= arg1;
} }
panic("unreachable")
} }
...@@ -70,7 +70,6 @@ const NoError = "No Error" ...@@ -70,7 +70,6 @@ const NoError = "No Error"
func (e *Error) String() string { func (e *Error) String() string {
if e == nil { if e == nil {
return NoError return NoError
} else {
return e.s
} }
return e.s
} }
...@@ -382,7 +382,7 @@ func Monmul(U PS, n int) PS{ ...@@ -382,7 +382,7 @@ func Monmul(U PS, n int) PS{
// Multiply by x // Multiply by x
func Xmul(U PS) PS{ func Xmul(U PS) PS{
Monmul(U,1); return Monmul(U,1);
} }
func Rep(c *rat) PS{ func Rep(c *rat) PS{
......
...@@ -16,6 +16,7 @@ func Alloc(i int) int { ...@@ -16,6 +16,7 @@ func Alloc(i int) int {
case 10: case 10:
return 10; return 10;
} }
return 0
} }
func main() { func main() {
......
...@@ -226,5 +226,8 @@ fixedbugs/bug073.go:9: illegal types for operand: RSH ...@@ -226,5 +226,8 @@ fixedbugs/bug073.go:9: illegal types for operand: RSH
=========== fixedbugs/bug081.go =========== fixedbugs/bug081.go
fixedbugs/bug081.go:5: syntax error fixedbugs/bug081.go:5: syntax error
=========== fixedbugs/bug086.go
fixedbugs/bug086.go:5: function ends without a return statement
=========== fixedbugs/bug091.go =========== fixedbugs/bug091.go
fixedbugs/bug091.go:14: label exit not defined fixedbugs/bug091.go:14: label exit not defined
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment