summaryrefslogtreecommitdiffstatshomepage
path: root/py/objlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/objlist.c')
-rw-r--r--py/objlist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/objlist.c b/py/objlist.c
index f3db99a637..59a4ad6b12 100644
--- a/py/objlist.c
+++ b/py/objlist.c
@@ -139,7 +139,9 @@ static mp_obj_t list_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
#if MICROPY_ENABLE_SLICE
if (MP_OBJ_IS_TYPE(rhs, &slice_type)) {
machine_uint_t start, stop;
- assert(m_seq_get_fast_slice_indexes(o->len, rhs, &start, &stop));
+ if (!m_seq_get_fast_slice_indexes(o->len, rhs, &start, &stop)) {
+ assert(0);
+ }
mp_obj_list_t *res = list_new(stop - start);
m_seq_copy(res->items, o->items + start, res->len, mp_obj_t);
return res;