From 78747ac6fbdcbca423ecaed65a5d6da9c3262b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 20 Aug 2009 12:18:57 +0200 Subject: [PATCH] Relax assumptions made in the precise VM stack marking procedure. * libguile/vm.c (vm_stack_mark): Change assertions into checks to determine whether VM points to a sane (initialized) object. The assumption previously was that free-list elements would be zeroed, as implied by the comment in , but this doesn't appear to be the case. --- libguile/vm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libguile/vm.c b/libguile/vm.c index 292092428..8fd378c6d 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -359,16 +359,12 @@ vm_stack_mark (GC_word *addr, struct GC_ms_entry *mark_stack_ptr, corresponding VM. */ vm = * ((struct scm_vm **) addr); - if (vm->stack_base == NULL) + if ((SCM *) addr != vm->stack_base - 1 + || vm->stack_limit - vm->stack_base != vm->stack_size) /* ADDR must be a pointer to a free-list element, which we must ignore (see warning in ). */ return mark_stack_ptr; - /* Sanity checks. */ - assert ((SCM *) addr == vm->stack_base - 1); - assert (vm->sp >= (SCM *) addr); - assert (vm->stack_limit - vm->stack_base == vm->stack_size); - for (word = (GC_word *) vm->stack_base; word <= (GC_word *) vm->sp; word++) mark_stack_ptr = GC_MARK_AND_PUSH ((* (GC_word **) word), mark_stack_ptr, mark_stack_limit,