Skip to content

Commit 31ad0d9

Browse files
Track executor before any possible deallocations
1 parent a667800 commit 31ad0d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Python/optimizer.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,10 @@ make_executor_from_uops(_PyUOpInstruction *buffer, int length, const _PyBloomFil
12221222
}
12231223
sanity_check(executor);
12241224
#endif
1225+
// Note: this MUST be here before any Py_DECREF(executor).
1226+
// Otherwise, the GC tries to untrack a still untracked object
1227+
// during dealloc.
1228+
_PyObject_GC_TRACK(executor);
12251229
#ifdef _Py_JIT
12261230
executor->jit_code = NULL;
12271231
executor->jit_side_entry = NULL;
@@ -1234,7 +1238,6 @@ make_executor_from_uops(_PyUOpInstruction *buffer, int length, const _PyBloomFil
12341238
return NULL;
12351239
}
12361240
#endif
1237-
_PyObject_GC_TRACK(executor);
12381241
return executor;
12391242
}
12401243

0 commit comments

Comments
 (0)