mirror of https://github.com/golang/go.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
This commit is contained in:
parent
0c8ed71079
commit
e5dae3baaa
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue