From: Marius Vollmer Date: Mon, 21 May 2001 12:26:37 +0000 (+0000) Subject: (scm_mem2symbol): Re-introduce indirect cell. It is X-Git-Url: https://git.hcoop.net/bpt/guile.git/commitdiff_plain/a7a59ea9d02dc5e043083616f8362c05aace1ef1 (scm_mem2symbol): Re-introduce indirect cell. It is needed for weak-key hashtables. --- diff --git a/libguile/symbols.c b/libguile/symbols.c index f78ece091..d46085a09 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -99,7 +99,7 @@ scm_mem2symbol (const char *name, scm_sizet len) for (l = SCM_VELTS (symbols) [hash]; !SCM_NULLP (l); l = SCM_CDR (l)) { - SCM sym = SCM_CAR (l); + SCM sym = SCM_CAAR (l); if (SCM_SYMBOL_HASH (sym) == raw_hash && SCM_SYMBOL_LENGTH (sym) == len) { @@ -124,6 +124,7 @@ scm_mem2symbol (const char *name, scm_sizet len) /* The symbol was not found - create it. */ SCM symbol; + SCM cell; SCM slot; SCM_NEWCELL2 (symbol); @@ -133,7 +134,8 @@ scm_mem2symbol (const char *name, scm_sizet len) SCM_SET_SYMBOL_LENGTH (symbol, (long) len); slot = SCM_VELTS (symbols) [hash]; - SCM_VELTS (symbols) [hash] = scm_cons (symbol, slot); + cell = scm_cons (symbol, SCM_UNDEFINED); + SCM_VELTS (symbols) [hash] = scm_cons (cell, slot); return symbol; }