@@ -502,8 +502,8 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
502
502
// Round up to the nearest page:
503
503
size_t page_size = get_page_size ();
504
504
assert ((page_size & (page_size - 1 )) == 0 );
505
- size_t padding = page_size - ((code_size + data_size + state .trampolines .size ) & (page_size - 1 ));
506
- size_t total_size = code_size + data_size + state .trampolines .size + padding ;
505
+ size_t padding = page_size - ((code_size + state .trampolines .size + data_size ) & (page_size - 1 ));
506
+ size_t total_size = code_size + state .trampolines .size + data_size + padding ;
507
507
unsigned char * memory = jit_alloc (total_size );
508
508
if (memory == NULL ) {
509
509
return -1 ;
@@ -524,8 +524,8 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
524
524
}
525
525
// Loop again to emit the code:
526
526
unsigned char * code = memory ;
527
- unsigned char * data = memory + code_size ;
528
- state . trampolines . mem = memory + code_size + data_size ;
527
+ state . trampolines . mem = memory + code_size ;
528
+ unsigned char * data = memory + code_size + state . trampolines . size ;
529
529
// Compile the shim, which handles converting between the native
530
530
// calling convention and the calling convention used by jitted code
531
531
// (which may be different for efficiency reasons).
@@ -547,7 +547,7 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
547
547
code += group -> code_size ;
548
548
data += group -> data_size ;
549
549
assert (code == memory + code_size );
550
- assert (data == memory + code_size + data_size );
550
+ assert (data == memory + code_size + state . trampolines . size + data_size );
551
551
#ifdef MAP_JIT
552
552
pthread_jit_write_protect_np (1 );
553
553
#endif
0 commit comments