summaryrefslogtreecommitdiff
path: root/libguile/vm.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-08-20 12:18:57 +0200
committerLudovic Courtès <ludo@gnu.org>2009-08-20 12:18:57 +0200
commit78747ac6fbdcbca423ecaed65a5d6da9c3262b58 (patch)
tree6cb5a8900b3c2ea5839a51767dd80b1925daaa21 /libguile/vm.c
parente3eb628d889b8cb9821a274e41b72f9751b6ee0a (diff)
downloadguile-78747ac6fbdcbca423ecaed65a5d6da9c3262b58.tar.gz
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 <gc/gc_mark.h>, but this doesn't appear to be the case.
Diffstat (limited to 'libguile/vm.c')
-rw-r--r--libguile/vm.c8
1 files 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 <gc/gc_mark.h>). */
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,