diff options
Diffstat (limited to 'libgo/runtime/go-panic.c')
-rw-r--r-- | libgo/runtime/go-panic.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libgo/runtime/go-panic.c b/libgo/runtime/go-panic.c index f3e182d..8b95cd4 100644 --- a/libgo/runtime/go-panic.c +++ b/libgo/runtime/go-panic.c @@ -41,14 +41,10 @@ __go_panic (struct __go_empty_interface arg) { struct __go_panic_stack *n; - if (__go_panic_defer == NULL) - __go_panic_defer = ((struct __go_panic_defer_struct *) - __go_alloc (sizeof (struct __go_panic_defer_struct))); - n = (struct __go_panic_stack *) __go_alloc (sizeof (struct __go_panic_stack)); n->__arg = arg; - n->__next = __go_panic_defer->__panic; - __go_panic_defer->__panic = n; + n->__next = g->panic; + g->panic = n; /* Run all the defer functions. */ @@ -57,7 +53,7 @@ __go_panic (struct __go_empty_interface arg) struct __go_defer_stack *d; void (*pfn) (void *); - d = __go_panic_defer->__defer; + d = g->defer; if (d == NULL) break; @@ -73,7 +69,7 @@ __go_panic (struct __go_empty_interface arg) /* Some defer function called recover. That means that we should stop running this panic. */ - __go_panic_defer->__panic = n->__next; + g->panic = n->__next; __go_free (n); /* Now unwind the stack by throwing an exception. The @@ -96,13 +92,13 @@ __go_panic (struct __go_empty_interface arg) *d->__frame = 0; } - __go_panic_defer->__defer = d->__next; + g->defer = d->__next; __go_free (d); } /* The panic was not recovered. */ - __printpanics (__go_panic_defer->__panic); + __printpanics (g->panic); /* FIXME: We should dump a call stack here. */ abort (); |