To: vim_dev@googlegroups.com Subject: Patch 9.0.0364 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0364 Problem: Clang static analyzer gives warnings. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #11043) Files: src/evalvars.c, src/float.c, src/highlight.c, src/mbyte.c, src/ops.c, src/tag.c, src/vim9compile.c *** ../vim-9.0.0363/src/evalvars.c 2022-09-02 11:25:34.074117570 +0100 --- src/evalvars.c 2022-09-03 10:23:00.926324260 +0100 *************** *** 1089,1095 **** { // +=, /=, etc. require an existing variable semsg(_(e_cannot_use_operator_on_new_variable), eap->arg); - i = FAIL; } else if (vim_strchr((char_u *)"+-*/%.", *expr) != NULL) { --- 1089,1094 ---- *************** *** 1112,1118 **** vim_strncpy(op, expr - len, len); semsg(_(e_white_space_required_before_and_after_str_at_str), op, argend); - i = FAIL; } if (eap->skip) --- 1111,1116 ---- *** ../vim-9.0.0363/src/float.c 2022-01-05 17:03:32.000000000 +0000 --- src/float.c 2022-09-03 10:39:48.506033243 +0100 *************** *** 54,65 **** if (skip_quotes && vim_strchr((char_u *)s, '\'') != NULL) { char_u buf[100]; ! char_u *p = buf; int quotes = 0; vim_strncpy(buf, (char_u *)s, 99); ! p = buf; ! for (;;) { // remove single quotes between digits, not in the exponent if (*p == '\'') --- 54,64 ---- if (skip_quotes && vim_strchr((char_u *)s, '\'') != NULL) { char_u buf[100]; ! char_u *p; int quotes = 0; vim_strncpy(buf, (char_u *)s, 99); ! for (p = buf; ; p = skipdigits(p)) { // remove single quotes between digits, not in the exponent if (*p == '\'') *************** *** 69,75 **** } if (!vim_isdigit(*p)) break; - p = skipdigits(p); } s = (char *)buf; f = strtod(s, &s); --- 68,73 ---- *** ../vim-9.0.0363/src/highlight.c 2022-08-31 21:17:06.461695535 +0100 --- src/highlight.c 2022-09-03 10:23:00.926324260 +0100 *************** *** 4515,4521 **** # endif p = add_attr_and_value(p, (char_u *)" guifg=", 7, guifg); p = add_attr_and_value(p, (char_u *)" guibg=", 7, guibg); ! p = add_attr_and_value(p, (char_u *)" guisp=", 7, guisp); do_highlight(hlsetBuf, forceit, FALSE); --- 4515,4521 ---- # endif p = add_attr_and_value(p, (char_u *)" guifg=", 7, guifg); p = add_attr_and_value(p, (char_u *)" guibg=", 7, guibg); ! (void)add_attr_and_value(p, (char_u *)" guisp=", 7, guisp); do_highlight(hlsetBuf, forceit, FALSE); *** ../vim-9.0.0363/src/mbyte.c 2022-09-01 12:22:19.747659165 +0100 --- src/mbyte.c 2022-09-03 10:23:00.926324260 +0100 *************** *** 5617,5623 **** } // Store the items in the new table. - item = 0; for (item = 0; item < l->lv_len; ++item) { listitem_T *lili = ptrs[item]; --- 5617,5622 ---- *** ../vim-9.0.0363/src/ops.c 2022-08-31 14:46:07.911016920 +0100 --- src/ops.c 2022-09-03 10:50:34.147975116 +0100 *************** *** 1282,1292 **** #ifdef FEAT_NETBEANS_INTG if (netbeans_active() && one_change) { ! char_u *ptr = ml_get_buf(curbuf, pos.lnum, FALSE); netbeans_removed(curbuf, pos.lnum, bd.textcol, (long)bd.textlen); ! // get the line again, it may have been flushed ptr = ml_get_buf(curbuf, pos.lnum, FALSE); netbeans_inserted(curbuf, pos.lnum, bd.textcol, &ptr[bd.textcol], bd.textlen); --- 1282,1292 ---- #ifdef FEAT_NETBEANS_INTG if (netbeans_active() && one_change) { ! char_u *ptr; netbeans_removed(curbuf, pos.lnum, bd.textcol, (long)bd.textlen); ! // get the line now, it may have been flushed ptr = ml_get_buf(curbuf, pos.lnum, FALSE); netbeans_inserted(curbuf, pos.lnum, bd.textcol, &ptr[bd.textcol], bd.textlen); *** ../vim-9.0.0363/src/tag.c 2022-08-25 18:12:00.350668422 +0100 --- src/tag.c 2022-09-03 10:23:00.926324260 +0100 *************** *** 4368,4374 **** { for (i = 0; i < num_matches; ++i) { ! parse_match(matches[i], &tp); is_static = test_for_static(&tp); // Skip pseudo-tag lines. --- 4368,4379 ---- { for (i = 0; i < num_matches; ++i) { ! if (parse_match(matches[i], &tp) == FAIL) ! { ! vim_free(matches[i]); ! continue; ! } ! is_static = test_for_static(&tp); // Skip pseudo-tag lines. *** ../vim-9.0.0363/src/vim9compile.c 2022-09-01 16:00:49.726496301 +0100 --- src/vim9compile.c 2022-09-03 10:23:00.930324258 +0100 *************** *** 2243,2251 **** r = compile_expr0_ext(&p, cctx, &is_const); if (lhs.lhs_new_local) ++cctx->ctx_locals.ga_len; - if (r == FAIL) - goto theend; } } else if (semicolon && var_idx == var_count - 1) { --- 2243,2251 ---- r = compile_expr0_ext(&p, cctx, &is_const); if (lhs.lhs_new_local) ++cctx->ctx_locals.ga_len; } + if (r == FAIL) + goto theend; } else if (semicolon && var_idx == var_count - 1) { *** ../vim-9.0.0363/src/version.c 2022-09-02 21:55:45.511049444 +0100 --- src/version.c 2022-09-03 10:51:56.859249805 +0100 *************** *** 709,710 **** --- 709,712 ---- { /* Add new patch number below this line */ + /**/ + 364, /**/ -- For large projects, Team Leaders use sophisticated project management software to keep track of who's doing what. The software collects the lies and guesses of the project team and organizes them in to instantly outdated charts that are too boring to look at closely. This is called "planning". (Scott Adams - The Dilbert principle) /// 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 ///