Add assertion in set_var_lval for null pointer.

If the lval is a index into a list, li should not be null.
This commit is contained in:
Paul Rigge 2017-12-30 20:53:01 -08:00
parent 9ad557fb2d
commit d63c3d9d10

View File

@ -2417,6 +2417,7 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv,
if (ri == NULL || (!lp->ll_empty2 && lp->ll_n2 == lp->ll_n1)) {
break;
}
assert(lp->ll_li != NULL);
if (TV_LIST_ITEM_NEXT(lp->ll_list, lp->ll_li) == NULL) {
// Need to add an empty item.
tv_list_append_number(lp->ll_list, 0);