To: vim_dev@googlegroups.com Subject: Patch 8.2.4898 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4898 Problem: Coverity complains about pointer usage. Solution: Move code for increment/decerment. Files: src/vim9compile.c *** ../vim-8.2.4897/src/vim9compile.c 2022-05-06 13:14:43.793076613 +0100 --- src/vim9compile.c 2022-05-07 09:59:53.842801034 +0100 *************** *** 2018,2037 **** 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 (VIM_ISWHITE(eap->cmd[2])) --- 2018,2023 ---- *************** *** 2044,2049 **** --- 2030,2052 ---- oplen = 2; 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) { *** ../vim-8.2.4897/src/version.c 2022-05-06 21:51:46.504145900 +0100 --- src/version.c 2022-05-07 10:03:00.962430325 +0100 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4898, /**/ -- hundred-and-one symptoms of being an internet addict: 123. You ask the car dealer to install an extra cigarette lighter on your new car to power your notebook. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///