From f59a605645def8e5afd5052e0e47836921c59c05 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9my=20Oudompheng?= Date: Wed, 7 Nov 2012 21:35:21 +0100 Subject: [PATCH] =?utf8?q?runtime:=20use=20runtime=C2=B7callers=20when=20r?= =?utf8?q?acefuncenter's=20pc=20is=20on=20the=20heap.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6821069 --- src/pkg/runtime/race.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.48.1