3m: fix zeroing out of weak-box secondary pointer when the secondary pointer has moved in the mark phase

svn: r6704
This commit is contained in:
Matthew Flatt 2007-06-20 02:22:30 +00:00
parent 94c820de78
commit 06b4cf70c9
3 changed files with 6 additions and 1 deletions

View File

@ -532,6 +532,7 @@ static int size_on_free_list(void *p)
/******************************************************************************/
static int is_marked(void *p);
#define weak_box_resolve(p) (p)
#include "weak.c"

View File

@ -1170,6 +1170,8 @@ static unsigned short ephemeron_tag;
#define is_marked(p) marked(p)
typedef short Type_Tag;
#define weak_box_resolve(p) GC_resolve(p)
#include "weak.c"
/*****************************************************************************/

View File

@ -223,7 +223,9 @@ static void zero_weak_boxes()
if (!is_marked(wb->val)) {
wb->val = NULL;
if (wb->secondary_erase) {
*(wb->secondary_erase + wb->soffset) = NULL;
void **p;
p = (void **)GC_resolve(wb->secondary_erase);
*(p + wb->soffset) = NULL;
wb->secondary_erase = NULL;
}
}