mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.4128: crash when method cannot be found
Problem: Crash when method cannot be found. (Christian J. Robinson) Solution: Don't mix up pointer names.
This commit is contained in:
parent
78f60322f7
commit
64283d5e1f
@ -4050,16 +4050,21 @@ eval_method(
|
|||||||
if (**arg != '(' && alias == NULL
|
if (**arg != '(' && alias == NULL
|
||||||
&& (paren = vim_strchr(*arg, '(')) != NULL)
|
&& (paren = vim_strchr(*arg, '(')) != NULL)
|
||||||
{
|
{
|
||||||
|
char_u *deref;
|
||||||
|
|
||||||
*arg = name;
|
*arg = name;
|
||||||
*paren = NUL;
|
*paren = NUL;
|
||||||
name = deref_function_name(arg, &tofree, evalarg, verbose);
|
deref = deref_function_name(arg, &tofree, evalarg, verbose);
|
||||||
if (name == NULL)
|
if (deref == NULL)
|
||||||
{
|
{
|
||||||
*arg = name + len;
|
*arg = name + len;
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
name = deref;
|
||||||
len = STRLEN(name);
|
len = STRLEN(name);
|
||||||
|
}
|
||||||
*paren = '(';
|
*paren = '(';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3214,6 +3214,14 @@ def Test_expr8_method_call_import()
|
|||||||
END
|
END
|
||||||
CheckScriptSuccess(lines)
|
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')
|
delete('Xsquare.vim')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4128,
|
||||||
/**/
|
/**/
|
||||||
4127,
|
4127,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user