1
0
forked from aniani/vim

patch 8.2.1102: Coverity gets confused by an unnecessary NULL check

Problem:    Coverity gets confused by an unnecessary NULL check.
Solution:   Remove the check for NULL.
This commit is contained in:
Bram Moolenaar
2020-07-01 13:04:05 +02:00
parent be7a50c22f
commit 9004949221
2 changed files with 10 additions and 6 deletions

View File

@@ -7374,6 +7374,7 @@ qf_free_stack(win_T *wp, qf_info_T *qi)
* Populate the quickfix list with the items supplied in the list * Populate the quickfix list with the items supplied in the list
* of dictionaries. "title" will be copied to w:quickfix_title. * of dictionaries. "title" will be copied to w:quickfix_title.
* "action" is 'a' for add, 'r' for replace. Otherwise create a new list. * "action" is 'a' for add, 'r' for replace. Otherwise create a new list.
* When "what" is not NULL then only set some properties.
*/ */
int int
set_errorlist( set_errorlist(
@@ -7401,7 +7402,7 @@ set_errorlist(
} }
// A dict argument cannot be specified with a non-empty list argument // A dict argument cannot be specified with a non-empty list argument
if (list != NULL && list->lv_len != 0 && what != NULL) if (list->lv_len != 0 && what != NULL)
{ {
semsg(_(e_invarg2), semsg(_(e_invarg2),
_("cannot have both a list and a \"what\" argument")); _("cannot have both a list and a \"what\" argument"));
@@ -8106,7 +8107,7 @@ set_qf_ll_list(
else else
{ {
list_T *l = list_arg->vval.v_list; list_T *l = list_arg->vval.v_list;
dict_T *d = NULL; dict_T *what = NULL;
int valid_dict = TRUE; int valid_dict = TRUE;
if (action_arg->v_type == VAR_STRING) if (action_arg->v_type == VAR_STRING)
@@ -8128,8 +8129,8 @@ set_qf_ll_list(
if (action_arg->v_type != VAR_UNKNOWN if (action_arg->v_type != VAR_UNKNOWN
&& what_arg->v_type != VAR_UNKNOWN) && what_arg->v_type != VAR_UNKNOWN)
{ {
if (what_arg->v_type == VAR_DICT) if (what_arg->v_type == VAR_DICT && what_arg->vval.v_dict != NULL)
d = what_arg->vval.v_dict; what = what_arg->vval.v_dict;
else else
{ {
emsg(_(e_dictreq)); emsg(_(e_dictreq));
@@ -8138,9 +8139,10 @@ set_qf_ll_list(
} }
++recursive; ++recursive;
if (l != NULL && action && valid_dict && set_errorlist(wp, l, action, if (l != NULL && action && valid_dict
&& set_errorlist(wp, l, action,
(char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"), (char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"),
d) == OK) what) == OK)
rettv->vval.v_number = 0; rettv->vval.v_number = 0;
--recursive; --recursive;
} }

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1102,
/**/ /**/
1101, 1101,
/**/ /**/