@@ -669,8 +669,7 @@ dummy_func(
669
669
STACK_SHRINK (2 );
670
670
new_frame -> localsplus [0 ] = container ;
671
671
new_frame -> localsplus [1 ] = sub ;
672
- assert (1 + INLINE_CACHE_ENTRIES_BINARY_SUBSCR == next_instr - this_instr );
673
- frame -> return_offset = 1 + INLINE_CACHE_ENTRIES_BINARY_SUBSCR ;
672
+ frame -> return_offset = (uint16_t )(next_instr - this_instr );
674
673
DISPATCH_INLINED (new_frame );
675
674
}
676
675
@@ -1000,8 +999,8 @@ dummy_func(
1000
999
gen -> gi_frame_state = FRAME_EXECUTING ;
1001
1000
gen -> gi_exc_state .previous_item = tstate -> exc_info ;
1002
1001
tstate -> exc_info = & gen -> gi_exc_state ;
1003
- assert (1 + INLINE_CACHE_ENTRIES_SEND == next_instr - this_instr );
1004
- frame -> return_offset = (uint16_t )(1 + INLINE_CACHE_ENTRIES_SEND + oparg );
1002
+ assert (next_instr - this_instr + oparg <= UINT16_MAX );
1003
+ frame -> return_offset = (uint16_t )(next_instr - this_instr + oparg );
1005
1004
DISPATCH_INLINED (gen_frame );
1006
1005
}
1007
1006
if (Py_IsNone (v ) && PyIter_Check (receiver )) {
@@ -1040,8 +1039,8 @@ dummy_func(
1040
1039
gen -> gi_frame_state = FRAME_EXECUTING ;
1041
1040
gen -> gi_exc_state .previous_item = tstate -> exc_info ;
1042
1041
tstate -> exc_info = & gen -> gi_exc_state ;
1043
- assert (1 + INLINE_CACHE_ENTRIES_SEND == next_instr - this_instr );
1044
- frame -> return_offset = (uint16_t )(1 + INLINE_CACHE_ENTRIES_SEND + oparg );
1042
+ assert (next_instr - this_instr + oparg <= UINT16_MAX );
1043
+ frame -> return_offset = (uint16_t )(next_instr - this_instr + oparg );
1045
1044
DISPATCH_INLINED (gen_frame );
1046
1045
}
1047
1046
@@ -2061,8 +2060,7 @@ dummy_func(
2061
2060
// Manipulate stack directly because we exit with DISPATCH_INLINED().
2062
2061
STACK_SHRINK (1 );
2063
2062
new_frame -> localsplus [0 ] = owner ;
2064
- assert (1 + INLINE_CACHE_ENTRIES_LOAD_ATTR == next_instr - this_instr );
2065
- frame -> return_offset = 1 + INLINE_CACHE_ENTRIES_LOAD_ATTR ;
2063
+ frame -> return_offset = (uint16_t )(next_instr - this_instr );
2066
2064
DISPATCH_INLINED (new_frame );
2067
2065
}
2068
2066
@@ -2088,8 +2086,7 @@ dummy_func(
2088
2086
STACK_SHRINK (1 );
2089
2087
new_frame -> localsplus [0 ] = owner ;
2090
2088
new_frame -> localsplus [1 ] = Py_NewRef (name );
2091
- assert (1 + INLINE_CACHE_ENTRIES_LOAD_ATTR == next_instr - this_instr );
2092
- frame -> return_offset = 1 + INLINE_CACHE_ENTRIES_LOAD_ATTR ;
2089
+ frame -> return_offset = (uint16_t )(next_instr - this_instr );
2093
2090
DISPATCH_INLINED (new_frame );
2094
2091
}
2095
2092
@@ -2732,8 +2729,8 @@ dummy_func(
2732
2729
tstate -> exc_info = & gen -> gi_exc_state ;
2733
2730
assert (next_instr [oparg ].op .code == END_FOR ||
2734
2731
next_instr [oparg ].op .code == INSTRUMENTED_END_FOR );
2735
- assert (1 + INLINE_CACHE_ENTRIES_FOR_ITER == next_instr - this_instr );
2736
- frame -> return_offset = (uint16_t )(1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg );
2732
+ assert (next_instr - this_instr + oparg <= UINT16_MAX );
2733
+ frame -> return_offset = (uint16_t )(next_instr - this_instr + oparg );
2737
2734
DISPATCH_INLINED (gen_frame );
2738
2735
}
2739
2736
@@ -3046,8 +3043,7 @@ dummy_func(
3046
3043
if (new_frame == NULL ) {
3047
3044
goto error ;
3048
3045
}
3049
- assert (1 + INLINE_CACHE_ENTRIES_CALL == next_instr - this_instr );
3050
- frame -> return_offset = 1 + INLINE_CACHE_ENTRIES_CALL ;
3046
+ frame -> return_offset = (uint16_t )(next_instr - this_instr );
3051
3047
DISPATCH_INLINED (new_frame );
3052
3048
}
3053
3049
/* Callable is not a normal Python function */
@@ -3202,8 +3198,7 @@ dummy_func(
3202
3198
}
3203
3199
// Manipulate stack and cache directly since we leave using DISPATCH_INLINED().
3204
3200
STACK_SHRINK (oparg + 2 );
3205
- assert (1 + INLINE_CACHE_ENTRIES_CALL == next_instr - this_instr );
3206
- frame -> return_offset = 1 + INLINE_CACHE_ENTRIES_CALL ;
3201
+ frame -> return_offset = (uint16_t )(next_instr - this_instr );
3207
3202
DISPATCH_INLINED (new_frame );
3208
3203
}
3209
3204
@@ -3279,8 +3274,7 @@ dummy_func(
3279
3274
for (int i = 0 ; i < oparg ; i ++ ) {
3280
3275
init_frame -> localsplus [i + 1 ] = args [i ];
3281
3276
}
3282
- assert (1 + INLINE_CACHE_ENTRIES_CALL == next_instr - this_instr );
3283
- frame -> return_offset = 1 + INLINE_CACHE_ENTRIES_CALL ;
3277
+ frame -> return_offset = (uint16_t )(next_instr - this_instr );
3284
3278
STACK_SHRINK (oparg + 2 );
3285
3279
_PyFrame_SetStackPointer (frame , stack_pointer );
3286
3280
/* Link frames */
0 commit comments