From b796cbc40657e0891a43bffab0ffb92ce656d8f1 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 8 Dec 2014 20:04:56 -0800 Subject: 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 --- src/runtime/malloc2.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/runtime/malloc2.go') 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. -- cgit v1.3