Patch 8.2.1102
Problem: Coverity gets confused by an unnecessary NULL check.
Solution: Remove the check for NULL.
Files: src/quickfix.c
*** ../vim-8.2.1101/src/quickfix.c 2020-06-30 22:11:40.962938410 +0200
--- src/quickfix.c 2020-07-01 13:02:22.015385505 +0200
***************
*** 7374,7379 ****
--- 7374,7380 ----
* Populate the quickfix list with the items supplied in the list
* of dictionaries. "title" will be copied to w:quickfix_title.
* "action" is 'a' for add, 'r' for replace. Otherwise create a new list.
+ * When "what" is not NULL then only set some properties.
*/
int
set_errorlist(
***************
*** 7401,7407 ****
}
// A dict argument cannot be specified with a non-empty list argument
! if (list != NULL && list->lv_len != 0 && what != NULL)
{
semsg(_(e_invarg2),
_("cannot have both a list and a \"what\" argument"));
--- 7402,7408 ----
}
// A dict argument cannot be specified with a non-empty list argument
! if (list->lv_len != 0 && what != NULL)
{
semsg(_(e_invarg2),
_("cannot have both a list and a \"what\" argument"));
***************
*** 8106,8112 ****
else
{
list_T *l = list_arg->vval.v_list;
! dict_T *d = NULL;
int valid_dict = TRUE;
if (action_arg->v_type == VAR_STRING)
--- 8107,8113 ----
else
{
list_T *l = list_arg->vval.v_list;
! dict_T *what = NULL;
int valid_dict = TRUE;
if (action_arg->v_type == VAR_STRING)
***************
*** 8128,8135 ****
if (action_arg->v_type != VAR_UNKNOWN
&& what_arg->v_type != VAR_UNKNOWN)
{
! if (what_arg->v_type == VAR_DICT)
! d = what_arg->vval.v_dict;
else
{
emsg(_(e_dictreq));
--- 8129,8136 ----
if (action_arg->v_type != VAR_UNKNOWN
&& what_arg->v_type != VAR_UNKNOWN)
{
! if (what_arg->v_type == VAR_DICT && what_arg->vval.v_dict != NULL)
! what = what_arg->vval.v_dict;
else
{
emsg(_(e_dictreq));
***************
*** 8138,8146 ****
}
++recursive;
! if (l != NULL && action && valid_dict && set_errorlist(wp, l, action,
(char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"),
! d) == OK)
rettv->vval.v_number = 0;
--recursive;
}
--- 8139,8148 ----
}
++recursive;
! if (l != NULL && action && valid_dict
! && set_errorlist(wp, l, action,
(char_u *)(wp == NULL ? ":setqflist()" : ":setloclist()"),
! what) == OK)
rettv->vval.v_number = 0;
--recursive;
}
*** ../vim-8.2.1101/src/version.c 2020-06-30 22:11:40.962938410 +0200
--- src/version.c 2020-07-01 13:03:18.366947888 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1102,
/**/
--
There are two ways of constructing a software design. One way is to make
it so simple that there are obviously no deficiencies. The other way
is to make it so complicated that there are no obvious deficiencies.
-C.A.R. Hoare
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202007011105.061B50cD1124503%40masaka.moolenaar.net.