This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
scm_intern_obarray_soft broken?
- To: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Subject: scm_intern_obarray_soft broken?
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Tue, 21 Mar 2000 16:28:17 +0100 (MET)
Hi!
scm_intern_obarray_soft seems completely broken to me: If the function is
called in order to enter a symbol into scm_symhash, we may actually end up
with the symbol entered in scm_weak_symhash.
Does anybody know if this is the intended behaviour? I don't know about
the exact difference between whether a symbol is in scm_symhash or in
scm_weak_symhash, but it seems like this could cause data to be garbage
collected which wasn't intended to be.
To explain the problem in more detail: The function does the following
things:
1) the obarray is scanned to see whether the symbol is already contained
in there.
2) if found, return the found entry
3) If the symbol was not found, the further behaviour depends on whether
scm_symhash is given as the obarray parameter. If anything else than
scm_symhash is given as the obarray parameter, the function performs
the following:
3a) enter the symbol into the given obarray
If, in contrast, scm_symhash is given as the obarray parameter, the
following special treatment is performed:
3b) if not found, scan scm_weak_symhash whether the symbol is contained
in there.
4b) if found in scm_weak_symhash, return that entry
5b) if not found in scm_weak_symhash, enter the symbol into
scm_weak_symhash
Best regards
Dirk Herrmann