summaryrefslogtreecommitdiff
path: root/src/gc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gc')
-rw-r--r--src/gc/sms.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gc/sms.c b/src/gc/sms.c
index 6261dc1..a2ab18e 100644
--- a/src/gc/sms.c
+++ b/src/gc/sms.c
@@ -95,7 +95,7 @@ static void gc_mark(const struct value initial_value) {
// - A black object has its mark bit set, but is not pointed to by obj, nor is
// it in the prev linked list.
struct object *prev = NULL;
- while (obj) {
+ for (;;) {
// INVARIANT: obj points to a white object that we're about to make gray.
// Since it's white, none of its fields should have the tag TAG_GC_INTERNAL,
// so it shouldn't have a saved tag either.
@@ -199,6 +199,7 @@ static void gc_sweep(void) {
while ((header = *head)) {
if ((*head)->mark) {
(*head)->mark = false;
+ (*head)->saved_tag = 0;
head = &header->next;
} else {
*head = header->next;