aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2013-08-29 15:53:34 -0700
committerKeith Randall <khr@golang.org>2013-08-29 15:53:34 -0700
commit32b770b2c05d69c41f0ab6719dc028cf4c79e334 (patch)
tree8b817260c14abd5682a6fd6b65d971c9a8fdf97a /src/pkg/runtime/proc.c
parent90351506d47dad652d9ee8cea56ffb5c50e0e953 (diff)
downloadgo-32b770b2c05d69c41f0ab6719dc028cf4c79e334.tar.xz
runtime: jump to badmcall instead of calling it.
This replaces the mcall frame with the badmcall frame instead of leaving the mcall frame on the stack and adding the badmcall frame. Because mcall is no longer on the stack, traceback will now report what called mcall, which is what we would like to see in this situation. R=golang-dev, cshapiro CC=golang-dev https://golang.org/cl/13012044
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index dab62ad69b..d37014f3a5 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -1997,14 +1997,16 @@ runtime·mcount(void)
}
void
-runtime·badmcall(void) // called from assembly
+runtime·badmcall(void (*fn)(G*)) // called from assembly
{
+ USED(fn); // TODO: print fn?
runtime·throw("runtime: mcall called on m->g0 stack");
}
void
-runtime·badmcall2(void) // called from assembly
+runtime·badmcall2(void (*fn)(G*)) // called from assembly
{
+ USED(fn);
runtime·throw("runtime: mcall function returned");
}