From 737087cbc8393b1a95a871b15a917872f1328c6b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 28 Nov 2011 05:45:49 +0000 Subject: runtime: Multiplex goroutines onto OS threads. From-SVN: r181772 --- libgo/runtime/go-unwind.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libgo/runtime/go-unwind.c') diff --git a/libgo/runtime/go-unwind.c b/libgo/runtime/go-unwind.c index 58c675a..c669a3c 100644 --- a/libgo/runtime/go-unwind.c +++ b/libgo/runtime/go-unwind.c @@ -47,8 +47,11 @@ static const _Unwind_Exception_Class __go_exception_class = void __go_check_defer (_Bool *frame) { + G *g; struct _Unwind_Exception *hdr; + g = runtime_g (); + if (g == NULL) { /* Some other language has thrown an exception. We know there @@ -164,7 +167,7 @@ __go_unwind_stack () sizeof hdr->exception_class); hdr->exception_cleanup = NULL; - g->exception = hdr; + runtime_g ()->exception = hdr; #ifdef __USING_SJLJ_EXCEPTIONS__ _Unwind_SjLj_RaiseException (hdr); @@ -280,6 +283,7 @@ PERSONALITY_FUNCTION (int version, _Unwind_Ptr landing_pad, ip; int ip_before_insn = 0; _Bool is_foreign; + G *g; #ifdef __ARM_EABI_UNWINDER__ _Unwind_Action actions; @@ -416,6 +420,7 @@ PERSONALITY_FUNCTION (int version, /* It's possible for g to be NULL here for an exception thrown by a language other than Go. */ + g = runtime_g (); if (g == NULL) { if (!is_foreign) -- cgit v1.1