summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/hash.c b/hash.c
index ccc5aa10..f7c32b51 100644
--- a/hash.c
+++ b/hash.c
@@ -159,7 +159,7 @@ static void hash_mark(val hash)
gc_mark(cdr(entry));
}
}
- reachable_weak_hashes->next = h;
+ h->next = reachable_weak_hashes;
reachable_weak_hashes = h;
break;
case hash_weak_vals:
@@ -175,7 +175,7 @@ static void hash_mark(val hash)
gc_mark(car(entry));
}
}
- reachable_weak_hashes->next = h;
+ h->next = reachable_weak_hashes;
reachable_weak_hashes = h;
break;
case hash_weak_both:
@@ -299,7 +299,10 @@ void hash_process_weak(void)
val *iter;
for (iter = pchain; *iter != nil; ) {
- val entry = car(*iter);
+ val entry;
+ (*iter)->t.type &= ~REACHABLE;
+ entry = car(*iter);
+ entry->t.type &= ~REACHABLE;
if (!gc_is_reachable(car(entry)))
*iter = cdr(*iter);
else
@@ -318,7 +321,10 @@ void hash_process_weak(void)
val *iter;
for (iter = pchain; *iter != nil; ) {
- val entry = car(*iter);
+ val entry;
+ (*iter)->t.type &= ~REACHABLE;
+ entry = car(*iter);
+ entry->t.type &= ~REACHABLE;
if (!gc_is_reachable(cdr(entry)))
*iter = cdr(*iter);
else
@@ -337,7 +343,10 @@ void hash_process_weak(void)
val *iter;
for (iter = pchain; *iter != nil; ) {
- val entry = car(*iter);
+ val entry;
+ (*iter)->t.type &= ~REACHABLE;
+ entry = car(*iter);
+ entry->t.type &= ~REACHABLE;
if (!gc_is_reachable(car(entry)) || !gc_is_reachable(cdr(entry)))
*iter = cdr(*iter);
else