Add 'FUNC_ATTR_NONNULL_RET' to nonnull alloc funcs (#14559)

This commit is contained in:
Jan Edmund Lazo
2021-05-15 20:36:13 -04:00
committed by GitHub
parent d67dcaba02
commit 6ab83f3572
5 changed files with 10 additions and 5 deletions

View File

@@ -2770,10 +2770,9 @@ static void f_get(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
} else if (strcmp(what, "args") == 0) {
rettv->v_type = VAR_LIST;
if (tv_list_alloc_ret(rettv, pt->pt_argc) != NULL) {
for (int i = 0; i < pt->pt_argc; i++) {
tv_list_append_tv(rettv->vval.v_list, &pt->pt_argv[i]);
}
tv_list_alloc_ret(rettv, pt->pt_argc);
for (int i = 0; i < pt->pt_argc; i++) {
tv_list_append_tv(rettv->vval.v_list, &pt->pt_argv[i]);
}
} else {
EMSG2(_(e_invarg2), what);