py: Clarify which mp_unary_op_t's may appear in the bytecode.

Not all can, so we don't need to reserve bytecodes for them, and can
use free slots for something else later.
This commit is contained in:
Paul Sokolovsky
2017-09-25 16:35:19 -07:00
parent f008263022
commit 9d836fedbd
5 changed files with 15 additions and 11 deletions

View File

@@ -539,7 +539,7 @@ const byte *mp_bytecode_print_str(const byte *ip) {
printf("LOAD_FAST " UINT_FMT, (mp_uint_t)ip[-1] - MP_BC_LOAD_FAST_MULTI);
} else if (ip[-1] < MP_BC_STORE_FAST_MULTI + 16) {
printf("STORE_FAST " UINT_FMT, (mp_uint_t)ip[-1] - MP_BC_STORE_FAST_MULTI);
} else if (ip[-1] < MP_BC_UNARY_OP_MULTI + 7) {
} else if (ip[-1] < MP_BC_UNARY_OP_MULTI + MP_UNARY_OP_NON_BYTECODE) {
printf("UNARY_OP " UINT_FMT, (mp_uint_t)ip[-1] - MP_BC_UNARY_OP_MULTI);
} else if (ip[-1] < MP_BC_BINARY_OP_MULTI + 36) {
mp_uint_t op = ip[-1] - MP_BC_BINARY_OP_MULTI;