@@ -899,7 +899,8 @@ make_executor_from_uops(_PyUOpInstruction *buffer, const _PyBloomFilter *depende
899
899
uint32_t used [(UOP_MAX_TRACE_LENGTH + 31 )/32 ] = { 0 };
900
900
int exit_count ;
901
901
int length = compute_used (buffer , used , & exit_count );
902
- _PyExecutorObject * executor = allocate_executor (exit_count , length + 1 );
902
+ length += 1 ; // For _START_EXECUTOR
903
+ _PyExecutorObject * executor = allocate_executor (exit_count , length );
903
904
if (executor == NULL ) {
904
905
return NULL ;
905
906
}
@@ -909,7 +910,7 @@ make_executor_from_uops(_PyUOpInstruction *buffer, const _PyBloomFilter *depende
909
910
executor -> exits [i ].temperature = 0 ;
910
911
}
911
912
int next_exit = exit_count - 1 ;
912
- _PyUOpInstruction * dest = (_PyUOpInstruction * )& executor -> trace [length ];
913
+ _PyUOpInstruction * dest = (_PyUOpInstruction * )& executor -> trace [length - 1 ];
913
914
/* Scan backwards, so that we see the destinations of jumps before the jumps themselves. */
914
915
for (int i = UOP_MAX_TRACE_LENGTH - 1 ; i >= 0 ; i -- ) {
915
916
if (!BIT_IS_SET (used , i )) {
@@ -957,7 +958,7 @@ make_executor_from_uops(_PyUOpInstruction *buffer, const _PyBloomFilter *depende
957
958
#ifdef _Py_JIT
958
959
executor -> jit_code = NULL ;
959
960
executor -> jit_size = 0 ;
960
- if (_PyJIT_Compile (executor , executor -> trace , length + 1 )) {
961
+ if (_PyJIT_Compile (executor , executor -> trace , length )) {
961
962
Py_DECREF (executor );
962
963
return NULL ;
963
964
}
0 commit comments