aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mfinal.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2015-10-21 12:30:58 -0700
committerMatthew Dempsky <mdempsky@google.com>2015-10-21 23:22:20 +0000
commit7df8ba136c911542374186fe5bed603ca6e7e015 (patch)
treebb0aa44604a5fbdc9e84f2593cf13bc4fdfd74fd /src/runtime/mfinal.go
parent84afa1be76f89a602c1aef73603175e644f1dc2f (diff)
downloadgo-7df8ba136c911542374186fe5bed603ca6e7e015.tar.gz
go-7df8ba136c911542374186fe5bed603ca6e7e015.zip
runtime: replace unsafe pointer arithmetic with array indexing
Change-Id: I313819abebd4cda4a6c30fd0fd6f44cb1d09161f Reviewed-on: https://go-review.googlesource.com/16167 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/mfinal.go')
-rw-r--r--src/runtime/mfinal.go2
1 files changed, 1 insertions, 1 deletions
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 {