aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc2.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-12-08 20:04:56 -0800
committerKeith Randall <khr@golang.org>2014-12-10 16:33:26 +0000
commitb796cbc40657e0891a43bffab0ffb92ce656d8f1 (patch)
tree66d700763b5f05903e9edace719b55bb5ffb0349 /src/runtime/malloc2.go
parent508a22d5bcec2508779fbc4e3e4c745ffe8ea961 (diff)
downloadgo-b796cbc40657e0891a43bffab0ffb92ce656d8f1.tar.xz
runtime: fix finalizer iterator
It could only handle one finalizer before it raised an out-of-bounds error. Fixes issue #9172 Change-Id: Ibb4d0c8aff2d78a1396e248c7129a631176ab427 Reviewed-on: https://go-review.googlesource.com/1201 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/malloc2.go')
-rw-r--r--src/runtime/malloc2.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/malloc2.go b/src/runtime/malloc2.go
index a9d40de306..cd8dc0ad8b 100644
--- a/src/runtime/malloc2.go
+++ b/src/runtime/malloc2.go
@@ -476,8 +476,8 @@ type finblock struct {
alllink *finblock
next *finblock
cnt int32
- cap int32
- fin [1]finalizer
+ _ int32
+ fin [(_FinBlockSize-2*ptrSize-2*4)/unsafe.Sizeof(finalizer{})]finalizer
}
// Information from the compiler about the layout of stack frames.