Various VM stack management fixes
authorAndy Wingo <wingo@pobox.com>
Wed, 5 Feb 2014 21:52:00 +0000 (22:52 +0100)
committerAndy Wingo <wingo@pobox.com>
Wed, 5 Feb 2014 21:52:00 +0000 (22:52 +0100)
commitb914b236c3d6a6772597278e97b80bdb34129291
tree41baad002b0f4dcbc8152b91bae331bdebb83d3e
parentb3ae2b5068cbfcb6e9eec7ff96cd936f1c861396
Various VM stack management fixes

* libguile/vm.c (vm_increase_sp): New interface, to increase the SP to
  some new level, possibly expanding the stack.
  (vm_push_sp, vm_restore_sp): Intefaces to vm_increase_sp.
  (vm_return_to_continuation): Don't throw an error if there's not
  enough space; instead, expand.
  (vm_reinstate_partial_continuation): Use the new helper.
  (return_unused_stack_to_os): Avoid off-by-one error (sp points to
  valid memory.)
  (scm_call_n): Never write beyond the sp.
libguile/vm-engine.c
libguile/vm.c