From a52cd5b07d6d6e2502fff2bbfb9e5b96562452a4 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Wed, 14 Jul 2021 17:14:16 +1000 Subject: 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 --- py/dynruntime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/dynruntime.h') 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; -- cgit v1.2.3