aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-unwind.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-09-16 05:47:20 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-09-16 05:47:20 +0000
commitb9f04a8461a67148848258f8e4b367a1b988038e (patch)
tree03800353a564c0cdcf3c12bb8940b28389b243a9 /libgo/runtime/go-unwind.c
parentfae3f4598af23b48fed264052e33d5516e31a56c (diff)
downloadgcc-b9f04a8461a67148848258f8e4b367a1b988038e.zip
gcc-b9f04a8461a67148848258f8e4b367a1b988038e.tar.gz
gcc-b9f04a8461a67148848258f8e4b367a1b988038e.tar.bz2
Fix defer when not calling recover in function with named results.
From-SVN: r178905
Diffstat (limited to 'libgo/runtime/go-unwind.c')
-rw-r--r--libgo/runtime/go-unwind.c10
1 files changed, 9 insertions, 1 deletions
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;
}