summaryrefslogtreecommitdiffstatshomepage
path: root/py/dynruntime.h
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/dynruntime.h
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/dynruntime.h')
-rw-r--r--py/dynruntime.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/dynruntime.h b/py/dynruntime.h
index fb748eb93f..be573bde2a 100644
--- a/py/dynruntime.h
+++ b/py/dynruntime.h
@@ -150,7 +150,7 @@ static inline mp_obj_t mp_obj_cast_to_native_base_dyn(mp_obj_t self_in, mp_const
if (MP_OBJ_FROM_PTR(self_type) == native_type) {
return self_in;
- } else if (self_type->parent != native_type) {
+ } else if (MP_OBJ_TYPE_GET_SLOT_OR_NULL(self_type, parent) != native_type) {
// The self_in object is not a direct descendant of native_type, so fail the cast.
// This is a very simple version of mp_obj_is_subclass_fast that could be improved.
return MP_OBJ_NULL;