summaryrefslogtreecommitdiff
path: root/py/objtype.c
diff options
context:
space:
mode:
authorRoy Hooper <rhooper@toybox.ca>2019-11-23 12:09:26 -0500
committerRoy Hooper <rhooper@toybox.ca>2019-11-23 12:09:26 -0500
commitc770ccd93917cf46a7b8cef7613ff389d7c3d18d (patch)
treee063f44fe16ce0d7411511f55bdea48d97e84420 /py/objtype.c
parentfa57de06886f3ec6785ec74676da0b08758c81c7 (diff)
make ->subscr take an instance to pass when instance_subscr is called from subscr.
Diffstat (limited to 'py/objtype.c')
-rw-r--r--py/objtype.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/py/objtype.c b/py/objtype.c
index 7d41b8656..41ebe7b61 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -823,7 +823,7 @@ STATIC void mp_obj_instance_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
}
}
-STATIC mp_obj_t instance_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
+STATIC mp_obj_t instance_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value, mp_obj_t instance) {
mp_obj_instance_t *self = MP_OBJ_TO_PTR(self_in);
mp_obj_t member[2] = {MP_OBJ_NULL};
struct class_lookup_data lookup = {
@@ -850,8 +850,7 @@ STATIC mp_obj_t instance_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value
meth_args = 3;
}
if (member[0] == MP_OBJ_SENTINEL) {
- mp_obj_t args[3] = {MP_OBJ_SENTINEL, self_in, self->subobj[0]};
- return mp_obj_subscr(args, index, value);
+ return mp_obj_subscr_impl(self->subobj[0], index, value, instance);
} 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