Skip to content

Commit 7764f16

Browse files
committed
py: Fix label printing in showbc; print sp in vm trace.
1 parent 1ca28bd commit 7764f16

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

py/showbc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,22 +299,22 @@ void mp_bytecode_print2(const byte *ip, mp_uint_t len) {
299299

300300
case MP_BC_POP_JUMP_IF_TRUE:
301301
DECODE_SLABEL;
302-
printf("POP_JUMP_IF_TRUE " UINT_FMT, ip + unum - ip_start);
302+
printf("POP_JUMP_IF_TRUE " INT_FMT, ip + unum - ip_start);
303303
break;
304304

305305
case MP_BC_POP_JUMP_IF_FALSE:
306306
DECODE_SLABEL;
307-
printf("POP_JUMP_IF_FALSE " UINT_FMT, ip + unum - ip_start);
307+
printf("POP_JUMP_IF_FALSE " INT_FMT, ip + unum - ip_start);
308308
break;
309309

310310
case MP_BC_JUMP_IF_TRUE_OR_POP:
311311
DECODE_SLABEL;
312-
printf("JUMP_IF_TRUE_OR_POP " UINT_FMT, ip + unum - ip_start);
312+
printf("JUMP_IF_TRUE_OR_POP " INT_FMT, ip + unum - ip_start);
313313
break;
314314

315315
case MP_BC_JUMP_IF_FALSE_OR_POP:
316316
DECODE_SLABEL;
317-
printf("JUMP_IF_FALSE_OR_POP " UINT_FMT, ip + unum - ip_start);
317+
printf("JUMP_IF_FALSE_OR_POP " INT_FMT, ip + unum - ip_start);
318318
break;
319319

320320
case MP_BC_SETUP_WITH:

py/vm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#include "objgenerator.h"
4242

4343
#if 0
44-
#define TRACE(ip) mp_bytecode_print2(ip, 1);
44+
#define TRACE(ip) printf("sp=" INT_FMT " ", sp - code_state->sp); mp_bytecode_print2(ip, 1);
4545
#else
4646
#define TRACE(ip)
4747
#endif

0 commit comments

Comments
 (0)