From 4c6b375960098c6596541b1e48c1210b10198d98 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 23 Apr 2014 03:22:10 +0300 Subject: [PATCH] showbc: MAKE_CLOSURE*: Update for new closed-over encoding. --- py/showbc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/py/showbc.c b/py/showbc.c index 4a8e12e68..2adbd01be 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -418,15 +418,19 @@ void mp_byte_code_print(const byte *ip, int len) { printf("MAKE_FUNCTION_DEFARGS " UINT_FMT, unum); break; - case MP_BC_MAKE_CLOSURE: + case MP_BC_MAKE_CLOSURE: { DECODE_PTR; - printf("MAKE_CLOSURE " UINT_FMT, unum); + machine_uint_t n_closed_over = *ip++; + printf("MAKE_CLOSURE " UINT_FMT " " UINT_FMT, unum, n_closed_over); break; + } - case MP_BC_MAKE_CLOSURE_DEFARGS: + case MP_BC_MAKE_CLOSURE_DEFARGS: { DECODE_PTR; - printf("MAKE_CLOSURE_DEFARGS " UINT_FMT, unum); + machine_uint_t n_closed_over = *ip++; + printf("MAKE_CLOSURE_DEFARGS " UINT_FMT " " UINT_FMT, unum, n_closed_over); break; + } case MP_BC_CALL_FUNCTION: DECODE_UINT;