diff options
author | Damien George <damien@micropython.org> | 2021-11-19 17:05:40 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-11-19 17:05:40 +1100 |
commit | 78ab2eeda311241fcb692336f6f8240d2c79e878 (patch) | |
tree | d3fe80bbca5a6a9b4ff203a6a23e4263979d8311 /py | |
parent | 8f0e304e65a83e1f52dfb29185159e8eb9f7f34d (diff) | |
download | micropython-78ab2eeda311241fcb692336f6f8240d2c79e878.tar.gz micropython-78ab2eeda311241fcb692336f6f8240d2c79e878.zip |
py/showbc: Print unary-op string when dumping bytecode.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py')
-rw-r--r-- | py/showbc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/py/showbc.c b/py/showbc.c index c321dfd755..f3bd5ea15e 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -519,7 +519,8 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip) { } else if (ip[-1] < MP_BC_STORE_FAST_MULTI + 16) { mp_printf(print, "STORE_FAST " UINT_FMT, (mp_uint_t)ip[-1] - MP_BC_STORE_FAST_MULTI); } else if (ip[-1] < MP_BC_UNARY_OP_MULTI + MP_UNARY_OP_NUM_BYTECODE) { - mp_printf(print, "UNARY_OP " UINT_FMT, (mp_uint_t)ip[-1] - MP_BC_UNARY_OP_MULTI); + mp_uint_t op = ip[-1] - MP_BC_UNARY_OP_MULTI; + mp_printf(print, "UNARY_OP " UINT_FMT " %s", op, qstr_str(mp_unary_op_method_name[op])); } else if (ip[-1] < MP_BC_BINARY_OP_MULTI + MP_BINARY_OP_NUM_BYTECODE) { mp_uint_t op = ip[-1] - MP_BC_BINARY_OP_MULTI; mp_printf(print, "BINARY_OP " UINT_FMT " %s", op, qstr_str(mp_binary_op_method_name[op])); |