From 012ceed914a24470207d602deeda3d6642787b4c Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 3 Sep 2014 11:35:22 -0400 Subject: runtime: make onM and mcall take Go func values This gives them correct types in Go and also makes it possible to use them to run Go code on an m stack. LGTM=iant R=golang-codereviews, dave, iant CC=dvyukov, golang-codereviews, khr, r https://golang.org/cl/137970044 --- src/pkg/runtime/panic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pkg/runtime/panic.c') diff --git a/src/pkg/runtime/panic.c b/src/pkg/runtime/panic.c index ecf4111337..4b6829e011 100644 --- a/src/pkg/runtime/panic.c +++ b/src/pkg/runtime/panic.c @@ -214,6 +214,7 @@ runtime·panic(Eface e) Defer *d, dabort; Panic p; uintptr pc, argp; + void (*fn)(G*); runtime·memclr((byte*)&p, sizeof p); p.arg = e; @@ -266,7 +267,8 @@ runtime·panic(Eface e) // Pass information about recovering frame to recovery. g->sigcode0 = (uintptr)argp; g->sigcode1 = (uintptr)pc; - runtime·mcall(recovery); + fn = recovery; + runtime·mcall(&fn); runtime·throw("recovery failed"); // mcall should not return } } -- cgit v1.3-5-g9baa