]> Cypherpunks repositories - gostls13.git/commit
runtime: improve atoi implementation
authorMartin Möhrmann <martisch@uos.de>
Sat, 29 Oct 2016 23:54:19 +0000 (01:54 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 1 Nov 2016 14:04:39 +0000 (14:04 +0000)
commitd7b34d5f29324d77fad572676f0ea139556235e0
tree25897e07f5b4624487d4384691ab758571faebff
parent40aaf283124de44d513ca086976194f0133faa82
runtime: improve atoi implementation

- Adds overflow checks
- Adds parsing of negative integers
- Adds boolean return value to signal parsing errors
- Adds atoi32 for parsing of integers that fit in an int32
- Adds tests

Handling of errors to provide error messages
at the call sites is left to future CLs.

Updates #17718

Change-Id: I3cacd0ab1230b9efc5404c68edae7304d39bcbc0
Reviewed-on: https://go-review.googlesource.com/32390
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/export_test.go
src/runtime/mgc.go
src/runtime/proc.go
src/runtime/runtime1.go
src/runtime/string.go
src/runtime/string_test.go