File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -408,6 +408,13 @@ translate_bytecode_to_trace(
408
408
ADD_TO_TRACE (SAVE_IP , (int )(instr - (_Py_CODEUNIT * )code -> co_code_adaptive ));
409
409
int opcode = instr -> op .code ;
410
410
uint64_t operand = instr -> op .arg ;
411
+ int extras = 0 ;
412
+ while (opcode == EXTENDED_ARG ) {
413
+ instr ++ ;
414
+ extras += 1 ;
415
+ opcode = instr -> op .code ;
416
+ operand = (operand << 8 ) | instr -> op .arg ;
417
+ }
411
418
switch (opcode ) {
412
419
case LOAD_FAST_LOAD_FAST :
413
420
case STORE_FAST_LOAD_FAST :
@@ -454,6 +461,15 @@ translate_bytecode_to_trace(
454
461
int offset = expansion -> uops [i ].offset ;
455
462
switch (expansion -> uops [i ].size ) {
456
463
case 0 :
464
+ if (extras && OPCODE_HAS_JUMP (opcode )) {
465
+ if (opcode == JUMP_BACKWARD_NO_INTERRUPT ) {
466
+ operand -= extras ;
467
+ }
468
+ else {
469
+ assert (opcode != JUMP_BACKWARD );
470
+ operand += extras ;
471
+ }
472
+ }
457
473
break ;
458
474
case 1 :
459
475
operand = read_u16 (& instr [offset ].cache );
You can’t perform that action at this time.
0 commit comments