summaryrefslogtreecommitdiffstatshomepage
path: root/py/objarray.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-03-14 23:12:54 +0000
committerDamien George <damien.p.george@gmail.com>2016-03-14 23:12:54 +0000
commit77f85db41e56a081a0e4c743d9d0ba0babe41b65 (patch)
treeeb8a0a7b33cd5c6dacb9b5b323e0dab6baeb591b /py/objarray.c
parent06b398489e312050bc13ef6ddaca52e77a8b119b (diff)
downloadmicropython-77f85db41e56a081a0e4c743d9d0ba0babe41b65.tar.gz
micropython-77f85db41e56a081a0e4c743d9d0ba0babe41b65.zip
py/objarray: Fix array slice assignment when array is reallocated.
Addresses issue #1898.
Diffstat (limited to 'py/objarray.c')
-rw-r--r--py/objarray.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/objarray.c b/py/objarray.c
index 58285c8660..da9dd528c5 100644
--- a/py/objarray.c
+++ b/py/objarray.c
@@ -439,6 +439,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value
// TODO: alloc policy; at the moment we go conservative
o->items = m_renew(byte, o->items, (o->len + o->free) * item_sz, (o->len + len_adj) * item_sz);
o->free = 0;
+ dest_items = o->items;
}
mp_seq_replace_slice_grow_inplace(dest_items, o->len,
slice.start, slice.stop, src_items, src_len, len_adj, item_sz);