Skip to content

Commit e0a9b70

Browse files
AJMansfielddpgeorge
authored andcommitted
py/objcode: Remove mp_obj_code_t.lnotab field from v2 preview.
This field exists to cache the lnotab field removed from v2 in micropython#17639 by ddf2c3a, and is now unused. Signed-off-by: Anson Mansfield <[email protected]>
1 parent 3cd95dd commit e0a9b70

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

py/objcode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ mp_obj_t mp_obj_new_code(const mp_module_context_t *context, const mp_raw_code_t
237237
o->context = context;
238238
o->rc = rc;
239239
o->dict_locals = mp_locals_get(); // this is a wrong! how to do this properly?
240+
#if !MICROPY_PREVIEW_VERSION_2
240241
o->lnotab = MP_OBJ_NULL;
242+
#endif
241243
return MP_OBJ_FROM_PTR(o);
242244
}
243245

py/objcode.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ static inline const void *mp_code_get_proto_fun(mp_obj_code_t *self) {
7575
#define MP_CODE_QSTR_MAP(context, idx) ((qstr)(context->constants.qstr_table[idx]))
7676

7777
typedef struct _mp_obj_code_t {
78-
// TODO this was 4 words
7978
mp_obj_base_t base;
8079
const mp_module_context_t *context;
8180
const mp_raw_code_t *rc;
8281
mp_obj_dict_t *dict_locals;
82+
#if !MICROPY_PREVIEW_VERSION_2
8383
mp_obj_t lnotab;
84+
#endif
8485
} mp_obj_code_t;
8586

8687
mp_obj_t mp_obj_new_code(const mp_module_context_t *context, const mp_raw_code_t *rc, bool result_required);

0 commit comments

Comments
 (0)