mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
[Backport release-0.7] fix seg fault in find_tagfunc_tags (#19503)
fix: fix seg fault in find_tagfunc_tags
(cherry picked from commit 187c02cc40
)
Co-authored-by: Frederick Mayle <fmayle@google.com>
This commit is contained in:
committed by
GitHub
parent
56834f4552
commit
ce7df6759c
@ -1150,7 +1150,15 @@ static int find_tagfunc_tags(char_u *pat, garray_T *ga, int *match_count, int fl
|
||||
typval_T args[4];
|
||||
typval_T rettv;
|
||||
char_u flagString[4];
|
||||
taggy_T *tag = &curwin->w_tagstack[curwin->w_tagstackidx];
|
||||
taggy_T *tag = NULL;
|
||||
|
||||
if (curwin->w_tagstacklen > 0) {
|
||||
if (curwin->w_tagstackidx == curwin->w_tagstacklen) {
|
||||
tag = &curwin->w_tagstack[curwin->w_tagstackidx - 1];
|
||||
} else {
|
||||
tag = &curwin->w_tagstack[curwin->w_tagstackidx];
|
||||
}
|
||||
}
|
||||
|
||||
if (*curbuf->b_p_tfu == NUL) {
|
||||
return FAIL;
|
||||
@ -1163,7 +1171,7 @@ static int find_tagfunc_tags(char_u *pat, garray_T *ga, int *match_count, int fl
|
||||
|
||||
// create 'info' dict argument
|
||||
dict_T *const d = tv_dict_alloc_lock(VAR_FIXED);
|
||||
if (tag->user_data != NULL) {
|
||||
if (tag != NULL && tag->user_data != NULL) {
|
||||
tv_dict_add_str(d, S_LEN("user_data"), (const char *)tag->user_data);
|
||||
}
|
||||
if (buf_ffname != NULL) {
|
||||
|
Reference in New Issue
Block a user