summaryrefslogtreecommitdiff
path: root/py/objtype.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-01-13 18:15:32 -0500
committerDan Halbert <halbert@halwitz.org>2020-01-13 18:15:32 -0500
commit2a75196aa3598b3daf4c6fcebdc47dcad597b332 (patch)
tree7c615930405baea093ec7c61e29dcf91c3b6c01b /py/objtype.c
parent4ad004f24eb79a382f1e6230f8ff02784d469d87 (diff)
parent2eb26a6d0b48fb82932190f67475ec101969d3ac (diff)
merge from adafruit/circuitpython
Diffstat (limited to 'py/objtype.c')
-rw-r--r--py/objtype.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/py/objtype.c b/py/objtype.c
index 0212a78da..a5e733208 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -34,6 +34,7 @@
#include "py/objtype.h"
#include "py/runtime.h"
+#include "supervisor/shared/stack.h"
#include "supervisor/shared/translate.h"
#if MICROPY_DEBUG_VERBOSE // print debugging info
@@ -851,8 +852,13 @@ STATIC mp_obj_t instance_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value
mp_obj_class_lookup(&lookup, self->base.type);
meth_args = 3;
}
- if (member[0] == MP_OBJ_SENTINEL) {
- return mp_obj_subscr(self->subobj[0], index, value);
+ if (member[0] == MP_OBJ_SENTINEL) { // native base subscr exists
+ mp_obj_type_t *subobj_type = mp_obj_get_type(self->subobj[0]);
+ // return mp_obj_subscr(self->subobj[0], index, value, instance);
+ mp_obj_t ret = subobj_type->subscr(self_in, index, value);
+ // May have called port specific C code. Make sure it didn't mess up the heap.
+ assert_heap_ok();
+ return ret;
} else if (member[0] != MP_OBJ_NULL) {
mp_obj_t args[3] = {self_in, index, value};
// TODO probably need to call mp_convert_member_lookup, and use mp_call_method_n_kw