summaryrefslogtreecommitdiffstatshomepage
path: root/py/objarray.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2021-07-14 17:14:16 +1000
committerDamien George <damien@micropython.org>2022-09-19 19:06:07 +1000
commita52cd5b07d6d6e2502fff2bbfb9e5b96562452a4 (patch)
treeabfbfe05586fe9c19d31adb32e82c59481ad611a /py/objarray.c
parente8355eb16357b0bd234a9bcab1c9e8b72fcdbabc (diff)
downloadmicropython-a52cd5b07d6d6e2502fff2bbfb9e5b96562452a4.tar.gz
micropython-a52cd5b07d6d6e2502fff2bbfb9e5b96562452a4.zip
py/obj: Add accessors for type slots and use everywhere.
This is a no-op, but sets the stage for changing the mp_obj_type_t representation. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/objarray.c')
-rw-r--r--py/objarray.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objarray.c b/py/objarray.c
index 1cb163c4b9..762a4105c5 100644
--- a/py/objarray.c
+++ b/py/objarray.c
@@ -443,7 +443,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value
size_t src_len;
void *src_items;
size_t item_sz = mp_binary_get_size('@', o->typecode & TYPECODE_MASK, NULL);
- if (mp_obj_is_obj(value) && ((mp_obj_base_t *)MP_OBJ_TO_PTR(value))->type->subscr == array_subscr) {
+ if (mp_obj_is_obj(value) && MP_OBJ_TYPE_GET_SLOT_OR_NULL(((mp_obj_base_t *)MP_OBJ_TO_PTR(value))->type, subscr) == array_subscr) {
// value is array, bytearray or memoryview
mp_obj_array_t *src_slice = MP_OBJ_TO_PTR(value);
if (item_sz != mp_binary_get_size('@', src_slice->typecode & TYPECODE_MASK, NULL)) {