summaryrefslogtreecommitdiff
path: root/libgo/runtime/go-unwind.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-11-28 05:45:49 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-11-28 05:45:49 +0000
commit737087cbc8393b1a95a871b15a917872f1328c6b (patch)
treeaf256a0152425084325ad100d75615322c726b8a /libgo/runtime/go-unwind.c
parenta01207c473dcab88eb0ac769d2d9c68d7c9e0588 (diff)
downloadgcc-737087cbc8393b1a95a871b15a917872f1328c6b.tar.gz
runtime: Multiplex goroutines onto OS threads.
From-SVN: r181772
Diffstat (limited to 'libgo/runtime/go-unwind.c')
-rw-r--r--libgo/runtime/go-unwind.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libgo/runtime/go-unwind.c b/libgo/runtime/go-unwind.c
index 58c675a2dc8..c669a3ce889 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)