diff --git a/Python/gc.c b/Python/gc.c index 3d36792ffb27fc..aa14642e9c8378 100644 --- a/Python/gc.c +++ b/Python/gc.c @@ -1527,12 +1527,12 @@ gc_collect_region(PyThreadState *tstate, if (untrack & UNTRACK_DICTS) { untrack_dicts(from); } + /* Move reachable objects to next generation. */ validate_consistent_old_space(to); if (from != to) { gc_list_merge(from, to); } validate_consistent_old_space(to); - /* Move reachable objects to next generation. */ /* All objects in unreachable are trash, but objects reachable from * legacy finalizers (e.g. tp_del) can't safely be deleted.