From 4ea1f83d9144574056eef2df776e6729302fe5c3 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sat, 25 Sep 1999 23:41:09 +0000 Subject: * root.c (scm_make_root): Initialize all the fields of the new root. GC could happen any time, you know. (Thanks to Greg Harvey.) --- libguile/root.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'libguile/root.c') diff --git a/libguile/root.c b/libguile/root.c index 1dbdbcd57..b0b0c7cd7 100644 --- a/libguile/root.c +++ b/libguile/root.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998, 1999 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -133,6 +133,27 @@ scm_make_root (parent) else { root_state->parent = SCM_BOOL_F; + + /* Initialize everything right now, in case a GC happens early. */ + root_state->rootcont + = root_state->dynwinds + = root_state->continuation_stack + = root_state->continuation_stack_ptr + = root_state->progargs + = root_state->exitval + = root_state->cur_inp + = root_state->cur_outp + = root_state->cur_errp + = root_state->def_inp + = root_state->def_outp + = root_state->def_errp + = root_state->cur_loadp + = root_state->fluids + = root_state->system_transformer + = root_state->top_level_lookup_closure_var + = root_state->handle + = root_state->parent + = SCM_BOOL_F; } SCM_REDEFER_INTS; SCM_NEWSMOB (root, scm_tc16_root, root_state); -- cgit v1.2.3