From a320eeff00f42b7956735ff746db0c46479191f2 Mon Sep 17 00:00:00 2001 From: Luke Gruber Date: Thu, 1 Oct 2026 13:56:03 -0400 Subject: [PATCH] Remove redundant check in rgengc_check_relation WB-unprotected objects are always young. This invariant is maintained throughout the code base. When WB-unprotecting an object, the object gets de-aged. --- gc/default/default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc/default/default.c b/gc/default/default.c index c4a5fde32c5..468e5fe2a05 100644 --- a/gc/default/default.c +++ b/gc/default/default.c @@ -6234,7 +6234,7 @@ static void rgengc_check_relation(rb_objspace_t *objspace, VALUE obj) { if (objspace->rgengc.parent_object_old_p) { - if (RVALUE_WB_UNPROTECTED(objspace, obj) || !RVALUE_OLD_P(objspace, obj)) { + if (!RVALUE_OLD_P(objspace, obj)) { rgengc_remember(objspace, objspace->rgengc.parent_object); /* It is in the rememberset now, so its remaining children have nothing left * to ask for: stop testing them. */