From 5378c05508215f3ef9943ac0c719986e1765d17f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 29 Dec 2007 22:44:25 -0500 Subject: [PATCH] Fix bootstrap --- vm/code_heap.c | 14 +++++++++++--- vm/factor.c | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/vm/code_heap.c b/vm/code_heap.c index ffa5839ab2..93f078cfda 100755 --- a/vm/code_heap.c +++ b/vm/code_heap.c @@ -56,9 +56,17 @@ INLINE CELL compute_code_rel(F_REL *rel, return CREF(words_start,REL_ARGUMENT(rel)); case RT_XT: word = untag_word(get(CREF(words_start,REL_ARGUMENT(rel)))); - return (CELL)word->code - + sizeof(F_COMPILED) - + (profiling_p_ ? 0 : word->code->profiler_prologue); + if(word->code) + { + return (CELL)word->code + + sizeof(F_COMPILED) + + (profiling_p_ ? 0 : word->code->profiler_prologue); + } + else + { + /* Its only NULL in stage 2 early init */ + return 0; + } case RT_XT_PROFILING: word = untag_word(get(CREF(words_start,REL_ARGUMENT(rel)))); return (CELL)word->code + sizeof(F_COMPILED); diff --git a/vm/factor.c b/vm/factor.c index 7b74ef6532..76c4acc4b9 100755 --- a/vm/factor.c +++ b/vm/factor.c @@ -32,7 +32,7 @@ void default_parameters(F_PARAMETERS *p) /* Do some initialization that we do once only */ void do_stage1_init(void) { - fprintf(stderr,"*** Starting stage 2 early init...\n"); + fprintf(stderr,"*** Stage 2 early init... "); fflush(stderr); jit_compile(userenv[UNDEFINED_ENV]); @@ -60,7 +60,7 @@ void do_stage1_init(void) userenv[STAGE2_ENV] = T; - fprintf(stderr,"*** Finished stage 2 early init\n"); + fprintf(stderr,"done\n"); fflush(stderr); }