1
0
mirror of https://github.com/golang/go synced 2024-11-19 22:44:45 -07:00

runtime: use runtime·callers when racefuncenter's pc is on the heap.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6821069
This commit is contained in:
Rémy Oudompheng 2012-11-07 21:35:21 +01:00
parent e08008e8c5
commit f59a605645

View File

@ -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;