1
0
mirror of https://github.com/golang/go synced 2024-11-12 08:20:22 -07:00

runtime: fix race detector handling of stackalloc()

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6632051
This commit is contained in:
Dmitriy Vyukov 2012-10-10 18:06:29 +04:00
parent f04ae1373e
commit 27e93fbd00

View File

@ -92,8 +92,11 @@ runtime·racefuncexit(void)
void
runtime·racemalloc(void *p, uintptr sz, void *pc)
{
// use m->curg because runtime·stackalloc() is called from g0
if(m->curg == nil)
return;
m->racecall = true;
runtimerace·Malloc(g->goid-1, p, sz, pc);
runtimerace·Malloc(m->curg->goid-1, p, sz, pc);
m->racecall = false;
}