0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.3171: another illegal memory access in test

Problem:    Another illegal memory access in test.
Solution:   Check pointer is after the start of the line.
This commit is contained in:
Bram Moolenaar
2021-07-15 23:44:54 +02:00
parent d8cee76b49
commit f5f1b59d3b
2 changed files with 3 additions and 1 deletions

View File

@@ -875,7 +875,7 @@ get_function_body(
--end; --end;
while (end > p && VIM_ISWHITE(*end)) while (end > p && VIM_ISWHITE(*end))
--end; --end;
if (end > p - 2 && end[-1] == '=' && end[0] == '>') if (end > p + 2 && end[-1] == '=' && end[0] == '>')
{ {
// found trailing "=> {", start of an inline function // found trailing "=> {", start of an inline function
if (nesting == MAX_FUNC_NESTING - 1) if (nesting == MAX_FUNC_NESTING - 1)

View File

@@ -755,6 +755,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 */
/**/
3171,
/**/ /**/
3170, 3170,
/**/ /**/