mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.4898: Coverity complains about pointer usage
Problem: Coverity complains about pointer usage. Solution: Move code for increment/decerment.
This commit is contained in:
@@ -746,6 +746,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 */
|
||||||
|
/**/
|
||||||
|
4898,
|
||||||
/**/
|
/**/
|
||||||
4897,
|
4897,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -2018,20 +2018,6 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
|
|||||||
|
|
||||||
lhs.lhs_name = NULL;
|
lhs.lhs_name = NULL;
|
||||||
|
|
||||||
sp = p;
|
|
||||||
p = skipwhite(p);
|
|
||||||
op = p;
|
|
||||||
oplen = assignment_len(p, &heredoc);
|
|
||||||
|
|
||||||
if (var_count > 0 && oplen == 0)
|
|
||||||
// can be something like "[1, 2]->func()"
|
|
||||||
return arg;
|
|
||||||
|
|
||||||
if (oplen > 0 && (!VIM_ISWHITE(*sp) || !IS_WHITE_OR_NUL(op[oplen])))
|
|
||||||
{
|
|
||||||
error_white_both(op, oplen);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (eap->cmdidx == CMD_increment || eap->cmdidx == CMD_decrement)
|
if (eap->cmdidx == CMD_increment || eap->cmdidx == CMD_decrement)
|
||||||
{
|
{
|
||||||
if (VIM_ISWHITE(eap->cmd[2]))
|
if (VIM_ISWHITE(eap->cmd[2]))
|
||||||
@@ -2044,6 +2030,23 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
|
|||||||
oplen = 2;
|
oplen = 2;
|
||||||
incdec = TRUE;
|
incdec = TRUE;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sp = p;
|
||||||
|
p = skipwhite(p);
|
||||||
|
op = p;
|
||||||
|
oplen = assignment_len(p, &heredoc);
|
||||||
|
|
||||||
|
if (var_count > 0 && oplen == 0)
|
||||||
|
// can be something like "[1, 2]->func()"
|
||||||
|
return arg;
|
||||||
|
|
||||||
|
if (oplen > 0 && (!VIM_ISWHITE(*sp) || !IS_WHITE_OR_NUL(op[oplen])))
|
||||||
|
{
|
||||||
|
error_white_both(op, oplen);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (heredoc)
|
if (heredoc)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user