There are two main pits
1.XXXSLICE related opcode
#define SLICE #define slice_1 #define slice_2 #define slice_3 #define Store_slice#define store_slice_1 #define store_slice_2 #define store_ Slice_3 #define delete_slice #define#define#define Delete_ Slice_3
Because these macro definitions are continuous at compile and run time, the Python source code is operated in Slice+1,opcode-slice & 1.
If the permutation is discontinuous, there will be a problem.
2.call_functionxxx related opcode
/* The next 3 opcodes must be contiguous and satisfy (call_function_var-call_function) & 3 = = 1 */#define CA Ll_function_var /* #args + (#kwargs <<8) */#define CALL_FUNCTION_KW/ * #args + (#kwargs <<8) */# Define CALL_FUNCTION_VAR_KW /* #args + (#kwargs <<8) */
Similar to the 1 issue, CEVAL.C (opcode-call_function) & 3, so it must also be guaranteed (call_function_var-call_function) & 3 = = 1, and these three macros are continuously
Other reference https://zhuanlan.zhihu.com/p/25850970 can be
Displacement of the python2.7.13 opcode encountered some pits