From: Rémy Oudompheng Date: Wed, 7 Nov 2012 20:35:21 +0000 (+0100) Subject: runtime: use runtime·callers when racefuncenter's pc is on the heap. X-Git-Tag: go1.1rc2~1932 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f59a605645def8e5afd5052e0e47836921c59c05;p=gostls13.git runtime: use runtime·callers when racefuncenter's pc is on the heap. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6821069 --- diff --git a/src/pkg/runtime/race.c b/src/pkg/runtime/race.c index 49c7d4eb2c..a89986ad40 100644 --- a/src/pkg/runtime/race.c +++ b/src/pkg/runtime/race.c @@ -89,7 +89,10 @@ runtime·racefuncenter(uintptr pc) { // If the caller PC is lessstack, use slower runtime·callers // to walk across the stack split to find the real caller. - if(pc == (uintptr)runtime·lessstack) + // Same thing if the PC is on the heap, which should be a + // closure trampoline. + if(pc == (uintptr)runtime·lessstack || + (pc >= (uintptr)runtime·mheap.arena_start && pc < (uintptr)runtime·mheap.arena_used)) runtime·callers(2, &pc, 1); m->racecall = true;