Fix check for color of object.

This commit is contained in:
Jesse Brault 2025-10-14 21:21:26 -05:00
parent d09d945323
commit 434a113d97

View File

@ -114,9 +114,7 @@ fn collect_garbage(
for stack_value in stack { for stack_value in stack {
match stack_value { match stack_value {
DvmValue::Object(gc) => { DvmValue::Object(gc) => {
if gc.color() == GcColor::White { gray_stack.push(gc.clone());
gray_stack.push(gc.clone());
}
} }
_ => {} _ => {}
} }
@ -126,7 +124,9 @@ fn collect_garbage(
for field in current.data().borrow().fields() { for field in current.data().borrow().fields() {
match field { match field {
DvmValue::Object(object) => { DvmValue::Object(object) => {
gray_stack.push(object.clone()); if object.color() == GcColor::White {
gray_stack.push(object.clone());
}
} }
_ => {} _ => {}
} }