From: Matthew Dempsky Date: Wed, 21 Oct 2015 19:30:58 +0000 (-0700) Subject: runtime: replace unsafe pointer arithmetic with array indexing X-Git-Tag: go1.6beta1~753 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7df8ba136c911542374186fe5bed603ca6e7e015;p=gostls13.git runtime: replace unsafe pointer arithmetic with array indexing Change-Id: I313819abebd4cda4a6c30fd0fd6f44cb1d09161f Reviewed-on: https://go-review.googlesource.com/16167 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/runtime/mfinal.go b/src/runtime/mfinal.go index 24f35d2163..d6a8da9619 100644 --- a/src/runtime/mfinal.go +++ b/src/runtime/mfinal.go @@ -160,7 +160,7 @@ func runfinq() { } for fb != nil { for i := fb.cnt; i > 0; i-- { - f := (*finalizer)(add(unsafe.Pointer(&fb.fin), uintptr(i-1)*unsafe.Sizeof(finalizer{}))) + f := &fb.fin[i-1] framesz := unsafe.Sizeof((interface{})(nil)) + uintptr(f.nret) if framecap < framesz {