Patch 8.2.4128

5 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 18, 2022, 5:38:01 AM1/18/22
to vim...@googlegroups.com

Patch 8.2.4128
Problem: Crash when method cannot be found. (Christian J. Robinson)
Solution: Don't mix up pointer names.
Files: src/eval.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.4127/src/eval.c 2022-01-17 21:13:24.474867011 +0000
--- src/eval.c 2022-01-18 10:35:03.677677097 +0000
***************
*** 4050,4065 ****
if (**arg != '(' && alias == NULL
&& (paren = vim_strchr(*arg, '(')) != NULL)
{
*arg = name;
*paren = NUL;
! name = deref_function_name(arg, &tofree, evalarg, verbose);
! if (name == NULL)
{
*arg = name + len;
ret = FAIL;
}
else
len = STRLEN(name);
*paren = '(';
}

--- 4050,4070 ----
if (**arg != '(' && alias == NULL
&& (paren = vim_strchr(*arg, '(')) != NULL)
{
+ char_u *deref;
+
*arg = name;
*paren = NUL;
! deref = deref_function_name(arg, &tofree, evalarg, verbose);
! if (deref == NULL)
{
*arg = name + len;
ret = FAIL;
}
else
+ {
+ name = deref;
len = STRLEN(name);
+ }
*paren = '(';
}

*** ../vim-8.2.4127/src/testdir/test_vim9_expr.vim 2022-01-17 20:50:36.491316623 +0000
--- src/testdir/test_vim9_expr.vim 2022-01-18 10:35:46.481600466 +0000
***************
*** 3214,3219 ****
--- 3214,3227 ----
END
CheckScriptSuccess(lines)

+ lines =<< trim END
+ vim9script
+ import './Xsquare.vim'
+
+ echo range(5)->Xsquare.NoSuchFunc()
+ END
+ CheckScriptFailure(lines, 'E1048: Item not found in script: NoSuchFunc')
+
delete('Xsquare.vim')
enddef

*** ../vim-8.2.4127/src/version.c 2022-01-17 22:16:29.862803979 +0000
--- src/version.c 2022-01-18 10:36:59.961471918 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4128,
/**/

--
ARTHUR: I am your king!
WOMAN: Well, I didn't vote for you.
ARTHUR: You don't vote for kings.
WOMAN: Well, 'ow did you become king then?
The Quest for the Holy Grail (Monty Python)

/// 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