diff options
| author | Martin Möhrmann <martisch@uos.de> | 2016-10-30 01:54:19 +0200 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-11-01 14:04:39 +0000 |
| commit | d7b34d5f29324d77fad572676f0ea139556235e0 (patch) | |
| tree | 25897e07f5b4624487d4384691ab758571faebff /src/runtime/export_test.go | |
| parent | 40aaf283124de44d513ca086976194f0133faa82 (diff) | |
| download | go-d7b34d5f29324d77fad572676f0ea139556235e0.tar.xz | |
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>
Diffstat (limited to 'src/runtime/export_test.go')
| -rw-r--r-- | src/runtime/export_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index d83b3b0a49..f4a65fec18 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -32,6 +32,9 @@ var FuncPC = funcPC var Fastlog2 = fastlog2 +var Atoi = atoi +var Atoi32 = atoi32 + type LFNode struct { Next uint64 Pushcnt uintptr |
