Unwind-only stack overflow exceptions
authorAndy Wingo <wingo@pobox.com>
Thu, 20 Feb 2014 08:45:01 +0000 (09:45 +0100)
committerAndy Wingo <wingo@pobox.com>
Thu, 20 Feb 2014 08:45:01 +0000 (09:45 +0100)
commit7e2fd4e7f53c281307efd12b80df46346002a33d
tree324241c65afa58b0b1f75600716b69e932bd4334
parent5d20fd49fe53c2520e36e8bf983c7b7214b0ad2a
Unwind-only stack overflow exceptions

* module/ice-9/boot-9.scm (catch): Signal an early error if the handler
  or pre-unwind handler types aren't right.  This is more important than
  it was, given that we dispatch on type now when finding matching catch
  clauses.

* libguile/vm.c (vm_expand_stack): Use the standard
  scm_report_stack_overflow to signal stack overflow.  This will avoid
  running pre-unwind handlers.

* libguile/throw.h: Move scm_report_stack_overflow here.

* libguile/throw.c (catch): Define a version of catch in C.
  (throw_without_pre_unwind): New helper.  Besides serving as the
  pre-boot "throw" binding, it allows stack overflow to throw without
  running pre-unwind handlers.
  (scm_catch, scm_catch_with_pre_unwind_handler)
  (scm_with_throw_handler): Use the new catch in C.
  (scm_report_stack_overflow): Moved from stackchk.c; throws an
  unwind-only exception.

* libguile/stackchk.h:
* libguile/stackchk.c: Remove the scm_report_stack_overflow bits.
libguile/stackchk.c
libguile/stackchk.h
libguile/throw.c
libguile/throw.h
libguile/vm.c
module/ice-9/boot-9.scm