mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-142476: fix memory leak when creating JIT executors (GH-142492)
This commit is contained in:
parent
6b4bc6e6a2
commit
e2a7db7175
2 changed files with 9 additions and 2 deletions
|
|
@ -185,12 +185,17 @@ _PyOptimizer_Optimize(
|
|||
else {
|
||||
executor->vm_data.code = NULL;
|
||||
}
|
||||
executor->vm_data.chain_depth = chain_depth;
|
||||
assert(executor->vm_data.valid);
|
||||
_PyExitData *exit = _tstate->jit_tracer_state.initial_state.exit;
|
||||
if (exit != NULL) {
|
||||
exit->executor = executor;
|
||||
}
|
||||
executor->vm_data.chain_depth = chain_depth;
|
||||
assert(executor->vm_data.valid);
|
||||
else {
|
||||
// An executor inserted into the code object now has a strong reference
|
||||
// to it from the code object. Thus, we don't need this reference anymore.
|
||||
Py_DECREF(executor);
|
||||
}
|
||||
interp->compiling = false;
|
||||
return 1;
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue