summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnson Mansfield <amansfield@mantaro.com>2025-11-02 11:41:43 -0500
committerDamien George <damien@micropython.org>2025-11-03 14:02:55 +1100
commite0a9b7023b28ac920b9e8e82f9bb4e8fda49ab3e (patch)
treeac7a6d1256a650d218ba7610284a12ff166c430d
parent3cd95dda649b1b3c855a577cb8f97c874c7047d6 (diff)
py/objcode: Remove `mp_obj_code_t.lnotab` field from v2 preview.
This field exists to cache the lnotab field removed from v2 in #17639 by ddf2c3afb17c0ea3dd678d02d9c2f01bed5a3020, and is now unused. Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
-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);