Patch 8.2.4146

3 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 19, 2022, 12:23:35 PM1/19/22
to vim...@googlegroups.com

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 -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages