diff options
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/py/compile.c b/py/compile.c index 49dddb0bd..3ea6dd3a6 100644 --- a/py/compile.c +++ b/py/compile.c @@ -797,7 +797,7 @@ void close_over_variables_etc(compiler_t *comp, scope_t *this_scope, int n_pos_d EMIT_ARG(load_closure, id->qstr, id->local_num); #else // in Micro Python we load closures using LOAD_FAST - EMIT_ARG(load_fast, id->qstr, id->local_num); + EMIT_ARG(load_fast, id->qstr, id->flags, id->local_num); #endif nfree += 1; } @@ -2208,8 +2208,8 @@ STATIC void compile_trailer_paren_helper(compiler_t *comp, mp_parse_node_t pn_ar // get first argument to function bool found = false; for (int i = 0; i < comp->scope_cur->id_info_len; i++) { - if (comp->scope_cur->id_info[i].flags && ID_FLAG_IS_PARAM) { - EMIT_ARG(load_fast, MP_QSTR_, comp->scope_cur->id_info[i].local_num); + if (comp->scope_cur->id_info[i].flags & ID_FLAG_IS_PARAM) { + EMIT_ARG(load_fast, MP_QSTR_, comp->scope_cur->id_info[i].flags, comp->scope_cur->id_info[i].local_num); found = true; break; } @@ -2990,7 +2990,7 @@ void compile_scope(compiler_t *comp, scope_t *scope, pass_kind_t pass) { #if MICROPY_EMIT_CPYTHON EMIT_ARG(load_closure, MP_QSTR___class__, 0); // XXX check this is the correct local num #else - EMIT_ARG(load_fast, MP_QSTR___class__, id->local_num); + EMIT_ARG(load_fast, MP_QSTR___class__, id->flags, id->local_num); #endif } EMIT(return_value); @@ -3154,7 +3154,7 @@ void compile_scope_compute_things(compiler_t *comp, scope_t *scope) { if (num_free > 0) { for (int i = 0; i < scope->id_info_len; i++) { id_info_t *id = &scope->id_info[i]; - if (id->kind != ID_INFO_KIND_FREE || (id->flags && ID_FLAG_IS_PARAM)) { + if (id->kind != ID_INFO_KIND_FREE || (id->flags & ID_FLAG_IS_PARAM)) { id->local_num += num_free; } } |