We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70dacb9 commit 5595733Copy full SHA for 5595733
gen/gen_mpy.py
@@ -1340,10 +1340,12 @@ def register_int_ptr_type(convertor, *types):
1340
1341
STATIC mp_obj_t mp_lv_cast(mp_obj_t type_obj, mp_obj_t ptr_obj)
1342
{
1343
+ void *ptr = mp_to_ptr(ptr_obj);
1344
+ if (!ptr) return mp_const_none;
1345
mp_lv_struct_t *self = m_new_obj(mp_lv_struct_t);
1346
*self = (mp_lv_struct_t){
1347
.base = {(const mp_obj_type_t*)type_obj},
- .data = mp_to_ptr(ptr_obj)
1348
+ .data = ptr
1349
};
1350
return MP_OBJ_FROM_PTR(self);
1351
}
0 commit comments