Skip to content

Commit 658fd98

Browse files
add code object only after we add to trace
1 parent 3163d9b commit 658fd98

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python/optimizer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,6 @@ _PyJit_translate_single_bytecode_to_trace(
588588
PyCodeObject *old_code = _tstate->jit_tracer_state.prev_state.instr_code;
589589
bool progress_needed = (_tstate->jit_tracer_state.initial_state.chain_depth % MAX_CHAIN_DEPTH) == 0;
590590
_PyBloomFilter *dependencies = &_tstate->jit_tracer_state.prev_state.dependencies;
591-
// Can be NULL for the entry frame.
592-
if (old_code != NULL) {
593-
_Py_BloomFilter_Add(dependencies, old_code);
594-
}
595591
int trace_length = _tstate->jit_tracer_state.prev_state.code_curr_size;
596592
_PyUOpInstruction *trace = _tstate->jit_tracer_state.code_buffer;
597593
int max_length = _tstate->jit_tracer_state.prev_state.code_max_size;
@@ -744,6 +740,10 @@ _PyJit_translate_single_bytecode_to_trace(
744740
ADD_TO_TRACE(_SET_IP, 0, (uintptr_t)target_instr, target);
745741
}
746742

743+
// Can be NULL for the entry frame.
744+
if (old_code != NULL) {
745+
_Py_BloomFilter_Add(dependencies, old_code);
746+
}
747747

748748
switch (opcode) {
749749
case POP_JUMP_IF_NONE:

0 commit comments

Comments
 (0)