py/objarray: Fix sign mismatch in comparison.

Found when compiling with clang and -Wsign-compare.
This commit is contained in:
stijn 2020-03-31 14:19:52 +02:00 committed by Damien George
parent 7fb9edf436
commit dc4d119d3d
1 changed files with 1 additions and 1 deletions

View File

@ -445,7 +445,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value
}
#endif
if (len_adj > 0) {
if (len_adj > o->free) {
if ((size_t)len_adj > o->free) {
// 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 = len_adj;