0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -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;
while (end > p && VIM_ISWHITE(*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
if (nesting == MAX_FUNC_NESTING - 1)