From: Russ Cox Date: Thu, 14 Feb 2013 03:31:45 +0000 (-0500) Subject: runtime: tweak addfinroots to preserve original pointer X-Git-Tag: go1.1rc2~1044 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e5dae3baaa34c8cd596eb34d6619272921122f4d;p=gostls13.git runtime: tweak addfinroots to preserve original pointer Use local variable so that stack trace will show value of v. Fixes #4790. R=golang-dev, iant CC=golang-dev https://golang.org/cl/7300106 --- diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index 031a63c489..c9295bbc27 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -1255,13 +1255,14 @@ static void addfinroots(void *v) { uintptr size; + void *base; size = 0; - if(!runtime·mlookup(v, &v, &size, nil) || !runtime·blockspecial(v)) + if(!runtime·mlookup(v, &base, &size, nil) || !runtime·blockspecial(base)) runtime·throw("mark - finalizer inconsistency"); // do not mark the finalizer block itself. just mark the things it points at. - addroot((Obj){v, size, 0}); + addroot((Obj){base, size, 0}); } static void