*fixed an invalid iterator issue with ranged list.

This commit is contained in:
paladin-t 2016-04-18 18:29:02 +08:00
parent a42371a6ab
commit bf0df023e6

View File

@ -6401,15 +6401,18 @@ static bool_t _destroy_list_it(_list_it_t* it) {
static _list_it_t* _move_list_it_next(_list_it_t* it) { static _list_it_t* _move_list_it_next(_list_it_t* it) {
_list_it_t* result = 0; _list_it_t* result = 0;
if(!it || !it->list || !it->list->list || (!it->curr.node && !it->list->range_begin)) if(!it || !it->list || !it->list->list)
goto _exit; goto _exit;
if(it->list->lock < 0) { if(it->list->lock < 0) { /* Collection has been changed after got this iterator. */
result = it; result = it;
goto _exit; goto _exit;
} }
if(!it->curr.node && !it->list->range_begin)
goto _exit;
if(it->list->range_begin) { if(it->list->range_begin) {
if(it->list->lock) if(it->list->lock)
it->curr.ranging += sgn(it->list->count); it->curr.ranging += sgn(it->list->count);