From 7d0e89a11fe8a6d88f7136588f2222faae239f67 Mon Sep 17 00:00:00 2001 From: slava Date: Sat, 18 Nov 2006 09:04:11 +0000 Subject: [PATCH] Add an assertion to the code GC code --- vm/compiler.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vm/compiler.c b/vm/compiler.c index b429cae187..d1c1bf8134 100644 --- a/vm/compiler.c +++ b/vm/compiler.c @@ -270,7 +270,12 @@ void primitive_finalize_compile(void) { F_ARRAY *pair = untag_array(get(AREF(array,i))); F_WORD *word = untag_word(get(AREF(pair,0))); - word->xt = to_cell(get(AREF(pair,1))); + CELL xt = to_cell(get(AREF(pair,1))); + F_BLOCK *block = xt_to_block(xt); + if(block->status != B_ALLOCATED) + critical_error("bad XT",xt); + + word->xt = xt; word->compiledp = T; } @@ -278,7 +283,8 @@ void primitive_finalize_compile(void) for(i = 0; i < count; i++) { F_ARRAY *pair = untag_array(get(AREF(array,i))); - CELL xt = to_cell(get(AREF(pair,1))); + F_WORD *word = untag_word(get(AREF(pair,0))); + CELL xt = word->xt; iterate_code_heap_step(xt_to_compiled(xt),finalize_code_block); } }