From 459cf1f2593b74c0a70c314621cd304ea3117c10 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 31 Aug 2004 21:44:46 +0000 Subject: [PATCH] (scm_init_guile_1): move scm_weaks_prehistory before scm_struct_prehistory. The effect is that structs are freed before weak vectors are cleaned up. This fixes a bug reported by Kevin Ryde (putting a struct into a weak vector exposes a freed cell). --- libguile/ChangeLog | 7 +++++++ libguile/init.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index c17c1c2a5..983cbc33f 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +2004-08-31 Han-Wen Nienhuys + + * init.c (scm_init_guile_1): move scm_weaks_prehistory before + scm_struct_prehistory. The effect is that structs are freed before + weak vectors are cleaned up. This fixes a bug reported by Kevin + Ryde (putting a struct into a weak vector exposes a freed cell). + 2004-08-29 Rob Browning * ramap.c (s_scm_array_map_x): update documentation; rename ra0 to diff --git a/libguile/init.c b/libguile/init.c index 34e17ca53..1f61a3e3d 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -469,9 +469,9 @@ scm_init_guile_1 (SCM_STACKITEM *base) scm_debug_malloc_prehistory (); #endif scm_init_storage (); /* requires smob_prehistory */ + scm_weaks_prehistory (); /* requires storage */ scm_struct_prehistory (); /* requires storage */ scm_symbols_prehistory (); /* requires storage */ - scm_weaks_prehistory (); /* requires storage */ scm_init_subr_table (); scm_environments_prehistory (); /* requires storage */ scm_modules_prehistory (); /* requires storage */