Problem:
Solution:
https://github.com/vim/vim/pull/17984
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@zeertzjq commented on this pull request.
In src/fuzzy.c:
> + + if (items[i].lmatchpos) + list_unref(items[i].lmatchpos);
I don't think using list_unref() here makes sense. If list_append_list() fails, the remaining lists' reference counts are 0, so it's better to just use list_free() directly.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@glepnir commented on this pull request.
when 1 fails, 0 succeeds. the li->lv_refcount of 0 is 1. so using list_unref here is more safer 🤔
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@zeertzjq commented on this pull request.
I can't understand what you are talking about.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@glepnir pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@zeertzjq commented on this pull request.
In src/fuzzy.c:
> + + if (items[i].lmatchpos) + list_unref(items[i].lmatchpos);
No, if list_append_list() succeeds, you already set items[i].lmatchpos to NULL, so this isn't called. Furthermore, for lists that are successfully added to retlist, they should be freed along with retlist (which is by the caller), not here.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@zeertzjq commented on this pull request.
In src/fuzzy.c:
> + + if (items[i].lmatchpos) + list_unref(items[i].lmatchpos);
And you also need to change list_unref to list_free in the commit message.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@glepnir commented on this pull request.
yes, they should be free by fmatchlist. I have modified and updated
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
thanks
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.