py/showbc: Fix off-by-one when showing address of unknown opcode.

pull/4967/head
Milan Rossa 2019-08-05 17:06:22 +02:00 zatwierdzone przez Damien George
rodzic cd35dd9d9a
commit efdcd6baa7
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -540,7 +540,7 @@ const byte *mp_bytecode_print_str(const byte *ip) {
mp_uint_t op = ip[-1] - MP_BC_BINARY_OP_MULTI;
printf("BINARY_OP " UINT_FMT " %s", op, qstr_str(mp_binary_op_method_name[op]));
} else {
printf("code %p, byte code 0x%02x not implemented\n", ip, ip[-1]);
printf("code %p, byte code 0x%02x not implemented\n", ip - 1, ip[-1]);
assert(0);
return ip;
}