Commit e5dae3ba authored by Russ Cox's avatar Russ Cox

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
parent 0c8ed710
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment