diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-02 08:57:05 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-02 08:58:16 +0200 |
commit | ea2509d92cbb222854ceb0b323b616b807dd221b (patch) | |
tree | 9cc30cf55b4c563be2fe139996f727815732eb0e /py/objtuple.c | |
parent | 6964422cf426164b39abdc66f260be4f582309e0 (diff) |
Fix assert() usage.
Diffstat (limited to 'py/objtuple.c')
-rw-r--r-- | py/objtuple.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/py/objtuple.c b/py/objtuple.c index da714e08a..3e5041c9d 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -91,7 +91,9 @@ static mp_obj_t tuple_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_tuple_t *res = mp_obj_new_tuple(stop - start, NULL); m_seq_copy(res->items, o->items + start, res->len, mp_obj_t); return res; |