summaryrefslogtreecommitdiff
path: root/libgo/go/strconv/atof.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-07-30 14:28:58 -0700
committerIan Lance Taylor <iant@golang.org>2021-08-12 20:23:07 -0700
commitc5b21c3f4c17b0649155035d2f9aa97b2da8a813 (patch)
treec6d3a68b503ba5b16182acbb958e3e5dbc95a43b /libgo/go/strconv/atof.go
parent72be20e20299ec57b4bc9ba03d5b7d6bf10e97cc (diff)
downloadgcc-c5b21c3f4c17b0649155035d2f9aa97b2da8a813.tar.gz
libgo: update to Go1.17rc2
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341629
Diffstat (limited to 'libgo/go/strconv/atof.go')
-rw-r--r--libgo/go/strconv/atof.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/go/strconv/atof.go b/libgo/go/strconv/atof.go
index 1c500575cf0..6ecd4f14d8a 100644
--- a/libgo/go/strconv/atof.go
+++ b/libgo/go/strconv/atof.go
@@ -695,7 +695,7 @@ func atof64(s string) (f float64, n int, err error) {
// as their respective special floating point values. It ignores case when matching.
func ParseFloat(s string, bitSize int) (float64, error) {
f, n, err := parseFloatPrefix(s, bitSize)
- if err == nil && n != len(s) {
+ if n != len(s) && (err == nil || err.(*NumError).Err != ErrSyntax) {
return 0, syntaxError(fnParseFloat, s)
}
return f, err