From ea81292fa7d10df029d1e938e086bed648ab1120 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 26 Oct 2016 06:56:04 -0700 Subject: Let guard frames optionally pass through unwinding. We have a bug in that when an exception occurs in a context called from obj_print, the guard for stopping continuation captures across obj_print also unintentially blocks the unwinding. Let's make the unwinding blockage optional * unwind.c (uw_unwind_to_exit_point): If a UW_GUARD is encountered, do not abort if the uw_ok flag is set; keep unwinding. (uw_push_guard): New uw_ok argument, initializes the uw_ok member of a guard frame. * unwind.h (struct uw_guard): New struct type. (union uw_frame): New member gu of type struct uw_guard. (uw_push_guard): Declaration updated. * ftw.c (ftw_callback): Pass zero as new uw_push_guard argument: no unwinding across the POSIX library function ftw. * glob.c (errfunc_thunk): Likewise, no unwinding across the library function glob. * lib.c (obj_print): Pass 1 as new uw_push_guard argument: continuations can't be captured, but unwinding is okay. --- ftw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ftw.c') diff --git a/ftw.c b/ftw.c index 2c5a4a29..acc0ed16 100644 --- a/ftw.c +++ b/ftw.c @@ -52,7 +52,7 @@ static int ftw_callback(const char *c_path, const struct stat *c_sb, int c_result = 1; uw_frame_t cont_guard; - uw_push_guard(&cont_guard); + uw_push_guard(&cont_guard, 0); uw_simple_catch_begin; -- cgit v1.2.3