Commit 27e93fbd authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: fix race detector handling of stackalloc()

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6632051
parent f04ae137
...@@ -92,8 +92,11 @@ runtime·racefuncexit(void) ...@@ -92,8 +92,11 @@ runtime·racefuncexit(void)
void void
runtime·racemalloc(void *p, uintptr sz, void *pc) 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; m->racecall = true;
runtimerace·Malloc(g->goid-1, p, sz, pc); runtimerace·Malloc(m->curg->goid-1, p, sz, pc);
m->racecall = false; m->racecall = false;
} }
......
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