1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-21 11:10:21 +02:00

with-continuation-barrier carps, calls exit(3) _after_ unwinding

* libguile/continuations.c (scm_handler, c_handler)
  (scm_c_with_continuation_barrier, scm_with_continuation_barrier): Call
  scm_handle_by_message_noexit in the post-unwind handler, so that
  dynwinds

* test-suite/tests/continuations.test ("continuations"): Add a test.
This commit is contained in:
Andy Wingo 2011-03-24 20:20:14 +01:00
parent ad301b6d58
commit ecba00af65
2 changed files with 25 additions and 4 deletions

View file

@ -1,7 +1,7 @@
;;;; -*- scheme -*-
;;;; continuations.test --- test suite for continutations
;;;;
;;;; Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
;;;; Copyright (C) 2003, 2006, 2009, 2011 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@ -80,6 +80,17 @@
(error "Catch me if you can!")))))))))
handled))
(pass-if "exit unwinds dynwinds inside a continuation barrier"
(let ((s (with-error-to-string
(lambda ()
(with-continuation-barrier
(lambda ()
(dynamic-wind
(lambda () #f)
(lambda () (exit 1))
(lambda () (throw 'abcde)))))))))
(and (string-contains s "abcde") #t)))
(with-debugging-evaluator
(pass-if "make a stack from a continuation"