From b9f04a8461a67148848258f8e4b367a1b988038e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 16 Sep 2011 05:47:20 +0000 Subject: Fix defer when not calling recover in function with named results. From-SVN: r178905 --- libgo/runtime/go-unwind.c | 10 +++++++++- 1 file changed, 9 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 0bc3f1b..e64cf90 100644 --- a/libgo/runtime/go-unwind.c +++ b/libgo/runtime/go-unwind.c @@ -44,7 +44,7 @@ static const _Unwind_Exception_Class __go_exception_class = continue unwinding. */ void -__go_check_defer (void *frame) +__go_check_defer (_Bool *frame) { struct _Unwind_Exception *hdr; @@ -103,8 +103,12 @@ __go_check_defer (void *frame) if (was_recovered) { /* Just return and continue executing Go code. */ + *frame = 1; return; } + + /* We are panicing through this function. */ + *frame = 0; } else if (__go_panic_defer->__defer != NULL && __go_panic_defer->__defer->__pfn == NULL @@ -118,6 +122,10 @@ __go_check_defer (void *frame) d = __go_panic_defer->__defer; __go_panic_defer->__defer = d->__next; __go_free (d); + + /* We are returning from this function. */ + *frame = 1; + return; } -- cgit v1.1