summaryrefslogtreecommitdiff
path: root/libguile/continuations.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-04-17 09:27:32 +0200
committerAndy Wingo <wingo@pobox.com>2009-04-17 09:27:32 +0200
commit798244609bfd3b4d2b12f722d9130d47abcfeb1a (patch)
treeb3ab0a6f78afac769a323178f82e67cf5782f1a7 /libguile/continuations.c
parentb8076ec6cc3a18a92186d954684f88a735a42018 (diff)
downloadguile-798244609bfd3b4d2b12f722d9130d47abcfeb1a.tar.gz
fix a couple gc-related continuations bugs
Thanks to Juhani Rantanen for the report. * libguile/continuations.c (scm_make_continuation): Delay making the smob until the data is fully initialized. Fixes a bug whereby a GC in scm_vm_capture_continuations would catch the us with an undefined continuation->vm_conts, leading to marking badness. * libguile/vm.c (vm_cont_free): Report the correct size to scm_gc_free.
Diffstat (limited to 'libguile/continuations.c')
-rw-r--r--libguile/continuations.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/continuations.c b/libguile/continuations.c
index 2b10126cf..dc1456985 100644
--- a/libguile/continuations.c
+++ b/libguile/continuations.c
@@ -121,8 +121,6 @@ scm_make_continuation (int *first)
continuation->root = thread->continuation_root;
continuation->dframe = scm_i_last_debug_frame ();
src = thread->continuation_base;
- SCM_NEWSMOB (cont, scm_tc16_continuation, continuation);
-
#if ! SCM_STACK_GROWS_UP
src -= stack_size;
#endif
@@ -130,6 +128,8 @@ scm_make_continuation (int *first)
memcpy (continuation->stack, src, sizeof (SCM_STACKITEM) * stack_size);
continuation->vm_conts = scm_vm_capture_continuations ();
+ SCM_NEWSMOB (cont, scm_tc16_continuation, continuation);
+
*first = !setjmp (continuation->jmpbuf);
if (*first)
{