mirror of
https://github.com/vim/vim.git
synced 2025-10-05 05:34:07 -04:00
patch 8.2.2812: Vim9: still crash when using substitute expression
Problem: Vim9: still crash when using substitute expression. Solution: Put the instruction list in the stack frame. (closes #8154)
This commit is contained in:
@@ -1208,15 +1208,18 @@ def Test_substitute_expr()
|
||||
CheckDefFailure(['s/from/\="x"/9'], 'E488:')
|
||||
|
||||
# When calling a function the right instruction list needs to be restored.
|
||||
g:cond = true
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
def Foo()
|
||||
Bar([])
|
||||
enddef
|
||||
def Bar(l: list<number>)
|
||||
if g:cond
|
||||
s/^/\=Rep()/
|
||||
for n in l[:]
|
||||
endfor
|
||||
endif
|
||||
enddef
|
||||
def Rep(): string
|
||||
return 'rep'
|
||||
@@ -1227,6 +1230,7 @@ def Test_substitute_expr()
|
||||
bwipe!
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
unlet g:cond
|
||||
enddef
|
||||
|
||||
def Test_redir_to_var()
|
||||
|
Reference in New Issue
Block a user