summaryrefslogtreecommitdiff
path: root/libgo/runtime/go-unwind.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/go-unwind.c')
-rw-r--r--libgo/runtime/go-unwind.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libgo/runtime/go-unwind.c b/libgo/runtime/go-unwind.c
index 04b0a28607..849256b631 100644
--- a/libgo/runtime/go-unwind.c
+++ b/libgo/runtime/go-unwind.c
@@ -80,7 +80,6 @@ __go_check_defer (_Bool *frame)
{
struct __go_defer_stack *d;
void (*pfn) (void *);
- M *m;
d = g->defer;
if (d == NULL || d->__frame != frame || d->__pfn == NULL)
@@ -91,9 +90,8 @@ __go_check_defer (_Bool *frame)
(*pfn) (d->__arg);
- m = runtime_m ();
- if (m != NULL && m->mcache != NULL && d->__free)
- __go_free (d);
+ if (runtime_m () != NULL)
+ runtime_freedefer (d);
if (n->__was_recovered)
{
@@ -122,7 +120,6 @@ __go_check_defer (_Bool *frame)
&& g->defer->__frame == frame)
{
struct __go_defer_stack *d;
- M *m;
/* This is the defer function which called recover. Simply
return to stop the stack unwind, and let the Go code continue
@@ -130,9 +127,8 @@ __go_check_defer (_Bool *frame)
d = g->defer;
g->defer = d->__next;
- m = runtime_m ();
- if (m != NULL && m->mcache != NULL && d->__free)
- __go_free (d);
+ if (runtime_m () != NULL)
+ runtime_freedefer (d);
/* We are returning from this function. */
*frame = 1;