Skip to content

Commit ad78398

Browse files
committed
Store chain_depth earlier and DECREF executor
1 parent 7f497c3 commit ad78398

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/optimizer.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,14 @@ _PyOptimizer_Optimize(
185185
else {
186186
executor->vm_data.code = NULL;
187187
}
188+
executor->vm_data.chain_depth = chain_depth;
189+
assert(executor->vm_data.valid);
188190
_PyExitData *exit = _tstate->jit_tracer_state.initial_state.exit;
189191
if (exit != NULL) {
190192
exit->executor = executor;
193+
} else {
194+
Py_DECREF(executor);
191195
}
192-
executor->vm_data.chain_depth = chain_depth;
193-
assert(executor->vm_data.valid);
194196
interp->compiling = false;
195197
return 1;
196198
#else

0 commit comments

Comments
 (0)