objstr: Fix bugs introduced by inability to have shadow variables.

Warnings lead to programming errors - as expected.
This commit is contained in:
Paul Sokolovsky 2015-04-04 01:55:40 +03:00
parent acf6aec71c
commit 7f59b4b2ca
1 changed files with 2 additions and 2 deletions

View File

@ -519,8 +519,8 @@ STATIC inline mp_obj_t str_split_internal(mp_uint_t n_args, const mp_obj_t *args
s++; s++;
} }
mp_uint_t sub_len = s - start; mp_uint_t sub_len = s - start;
if (MP_LIKELY(!(len == 0 && s == top && (type && SPLITLINES)))) { if (MP_LIKELY(!(sub_len == 0 && s == top && (type && SPLITLINES)))) {
if (start + len != top && (type & KEEP)) { if (start + sub_len != top && (type & KEEP)) {
sub_len++; sub_len++;
} }
mp_obj_list_append(res, mp_obj_new_str_of_type(self_type, start, sub_len)); mp_obj_list_append(res, mp_obj_new_str_of_type(self_type, start, sub_len));