diff --git a/src/cmd/compile/internal/gc/esc.go b/src/cmd/compile/internal/gc/esc.go index c989f51f8c..578b30c97d 100644 --- a/src/cmd/compile/internal/gc/esc.go +++ b/src/cmd/compile/internal/gc/esc.go @@ -7,6 +7,7 @@ package gc import ( "cmd/internal/obj" "fmt" + "strconv" "strings" ) @@ -1124,7 +1125,8 @@ func parsetag(note *string) uint16 { if note == nil || !strings.HasPrefix(*note, "esc:") { return EscUnknown } - em := uint16(atoi((*note)[4:])) + n, _ := strconv.ParseInt((*note)[4:], 0, 0) + em := uint16(n) if em == 0 { return EscNone } diff --git a/src/cmd/compile/internal/gc/util.go b/src/cmd/compile/internal/gc/util.go index 6533c9aff9..7ed3b39b83 100644 --- a/src/cmd/compile/internal/gc/util.go +++ b/src/cmd/compile/internal/gc/util.go @@ -4,19 +4,12 @@ import ( "os" "runtime" "runtime/pprof" - "strconv" ) func (n *Node) Line() string { return Ctxt.LineHist.LineString(int(n.Lineno)) } -func atoi(s string) int { - // NOTE: Not strconv.Atoi, accepts hex and octal prefixes. - n, _ := strconv.ParseInt(s, 0, 0) - return int(n) -} - var atExitFuncs []func() func AtExit(f func()) {