To: vim_dev@googlegroups.com Subject: Patch 8.2.4146 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4146 Problem: Vim9: shadowed function can be used in compiled function but not at script level. Solution: Also give an error in a compiled function. (closes #9563) Files: src/vim9expr.c *** ../vim-8.2.4145/src/vim9expr.c 2022-01-18 17:43:01.061598437 +0000 --- src/vim9expr.c 2022-01-19 17:11:31.586187277 +0000 *************** *** 668,673 **** --- 668,688 ---- int res = FAIL; int is_autoload; int is_searchpair; + imported_T *import; + + if (varlen >= sizeof(namebuf)) + { + semsg(_(e_name_too_long_str), name); + return FAIL; + } + vim_strncpy(namebuf, *arg, varlen); + + import = find_imported(name, varlen, FALSE, cctx); + if (import != NULL) + { + semsg(_(e_cannot_use_str_itself_it_is_imported), namebuf); + return FAIL; + } // We can evaluate "has('name')" at compile time. // We always evaluate "exists_compiled()" at compile time. *************** *** 713,724 **** if (generate_ppconst(cctx, ppconst) == FAIL) return FAIL; - if (varlen >= sizeof(namebuf)) - { - semsg(_(e_name_too_long_str), name); - return FAIL; - } - vim_strncpy(namebuf, *arg, varlen); name = fname_trans_sid(namebuf, fname_buf, &tofree, &error); // We handle the "skip" argument of searchpair() and searchpairpos() --- 728,733 ---- *** ../vim-8.2.4145/src/version.c 2022-01-19 17:21:24.850755237 +0000 --- src/version.c 2022-01-19 17:22:22.017652261 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4146, /**/ -- If your life is a hard drive, Christ can be your backup. /// 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 ///