mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
vim-patch:8.2.1553: crash in edit test
Problem: Crash in edit test.
Solution: Avoid using invalid pointer.
2c93c685e3
This commit is contained in:
@@ -573,6 +573,9 @@ void foldCreate(win_T *wp, linenr_T start, linenr_T end)
|
|||||||
|
|
||||||
// Find the place to insert the new fold
|
// Find the place to insert the new fold
|
||||||
gap = &wp->w_folds;
|
gap = &wp->w_folds;
|
||||||
|
if (gap->ga_len == 0) {
|
||||||
|
i = 0;
|
||||||
|
} else {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!foldFind(gap, start_rel, &fp))
|
if (!foldFind(gap, start_rel, &fp))
|
||||||
break;
|
break;
|
||||||
@@ -596,8 +599,9 @@ void foldCreate(win_T *wp, linenr_T start, linenr_T end)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i = (int)(fp - (fold_T *)gap->ga_data);
|
i = (int)(fp - (fold_T *)gap->ga_data);
|
||||||
|
}
|
||||||
|
|
||||||
ga_grow(gap, 1);
|
ga_grow(gap, 1);
|
||||||
{
|
{
|
||||||
fp = (fold_T *)gap->ga_data + i;
|
fp = (fold_T *)gap->ga_data + i;
|
||||||
|
Reference in New Issue
Block a user