diff options
Diffstat (limited to 'py/objfun.c')
-rw-r--r-- | py/objfun.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/py/objfun.c b/py/objfun.c index 94f6d26d7e..f4d9dfb95e 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -126,12 +126,16 @@ mp_obj_t mp_make_function_var_between(int n_args_min, int n_args_max, mp_fun_var /******************************************************************************/ /* byte code functions */ -const char *mp_obj_fun_get_name(mp_obj_fun_bc_t *o) { - const byte *code_info = o->bytecode; +const char *mp_obj_code_get_name(const byte *code_info) { qstr block_name = code_info[8] | (code_info[9] << 8) | (code_info[10] << 16) | (code_info[11] << 24); return qstr_str(block_name); } +const char *mp_obj_fun_get_name(mp_obj_fun_bc_t *o) { + const byte *code_info = o->bytecode; + return mp_obj_code_get_name(code_info); +} + #if MICROPY_CPYTHON_COMPAT STATIC void fun_bc_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) { mp_obj_fun_bc_t *o = o_in; |