forked from aniani/vim
patch 9.0.0554: using freed memory when command follows lambda
Problem: Using freed memory when command follows lambda. Solution: Don't free what is still in use. (closes #11201)
This commit is contained in:
@@ -1515,6 +1515,20 @@ def Test_lambda_invalid_block()
|
||||
v9.CheckDefAndScriptFailure(lines, 'E488: Trailing characters: | echo')
|
||||
enddef
|
||||
|
||||
def Test_lambda_with_following_cmd()
|
||||
var lines =<< trim END
|
||||
set ts=2
|
||||
var Lambda = () => {
|
||||
set ts=4
|
||||
} | set ts=3
|
||||
assert_equal(3, &ts)
|
||||
Lambda()
|
||||
assert_equal(4, &ts)
|
||||
END
|
||||
v9.CheckDefAndScriptSuccess(lines)
|
||||
set ts=8
|
||||
enddef
|
||||
|
||||
def Test_pass_legacy_lambda_to_def_func()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
|
||||
Reference in New Issue
Block a user