mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-137007: Track executor before any possible deallocations (GH-137016)
This commit is contained in:
parent
26757d1351
commit
97e19014dd
2 changed files with 5 additions and 1 deletions
|
|
@ -1310,6 +1310,10 @@ make_executor_from_uops(_PyUOpInstruction *buffer, int length, const _PyBloomFil
|
|||
assert(next_exit == -1);
|
||||
assert(dest == executor->trace);
|
||||
assert(dest->opcode == _START_EXECUTOR);
|
||||
// Note: we MUST track it here before any Py_DECREF(executor) or
|
||||
// linking of executor. Otherwise, the GC tries to untrack a
|
||||
// still untracked object during dealloc.
|
||||
_PyObject_GC_TRACK(executor);
|
||||
_Py_ExecutorInit(executor, dependencies);
|
||||
#ifdef Py_DEBUG
|
||||
char *python_lltrace = Py_GETENV("PYTHON_LLTRACE");
|
||||
|
|
@ -1338,7 +1342,6 @@ make_executor_from_uops(_PyUOpInstruction *buffer, int length, const _PyBloomFil
|
|||
return NULL;
|
||||
}
|
||||
#endif
|
||||
_PyObject_GC_TRACK(executor);
|
||||
return executor;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue