0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.1482: Vim9: crash when using a nested lambda

Problem:    Vim9: crash when using a nested lambda.
Solution:   Do not clear the growarray when not evaluating.  Correct pointer
when getting the next line. (closes #6731)
This commit is contained in:
Bram Moolenaar
2020-08-18 22:32:03 +02:00
parent 3affe7a6c6
commit aeb2bdd0de
4 changed files with 18 additions and 3 deletions

View File

@@ -1624,6 +1624,15 @@ def Test_expr7_lambda_vim9script()
assert_equal(12, v)
END
CheckScriptSuccess(lines)
# nested lambda with line breaks
lines =<< trim END
vim9script
search('"', 'cW', 0, 0, {->
synstack('.', col('.'))
->map({_, v -> synIDattr(v, 'name')})->len()})
END
CheckScriptSuccess(lines)
enddef
def Test_expr7_dict()