summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--py/objcode.c2
-rw-r--r--py/objcode.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/py/objcode.c b/py/objcode.c
index 1ee33936c..09904f10f 100644
--- a/py/objcode.c
+++ b/py/objcode.c
@@ -237,7 +237,9 @@ mp_obj_t mp_obj_new_code(const mp_module_context_t *context, const mp_raw_code_t
o->context = context;
o->rc = rc;
o->dict_locals = mp_locals_get(); // this is a wrong! how to do this properly?
+ #if !MICROPY_PREVIEW_VERSION_2
o->lnotab = MP_OBJ_NULL;
+ #endif
return MP_OBJ_FROM_PTR(o);
}
diff --git a/py/objcode.h b/py/objcode.h
index 8f26bd9db..7be15e23f 100644
--- a/py/objcode.h
+++ b/py/objcode.h
@@ -75,12 +75,13 @@ static inline const void *mp_code_get_proto_fun(mp_obj_code_t *self) {
#define MP_CODE_QSTR_MAP(context, idx) ((qstr)(context->constants.qstr_table[idx]))
typedef struct _mp_obj_code_t {
- // TODO this was 4 words
mp_obj_base_t base;
const mp_module_context_t *context;
const mp_raw_code_t *rc;
mp_obj_dict_t *dict_locals;
+ #if !MICROPY_PREVIEW_VERSION_2
mp_obj_t lnotab;
+ #endif
} mp_obj_code_t;
mp_obj_t mp_obj_new_code(const mp_module_context_t *context, const mp_raw_code_t *rc, bool result_required);