patch 8.2.2051: Vim9: crash when aborting a user function call
Problem: Vim9: crash when aborting a user function call.
Solution: Do not use the return value when aboring. (closes #7372)
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 80d564e..8cb6ecf 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1468,6 +1468,29 @@
CheckScriptFailure(lines, 'E1012:')
enddef
+def Test_failure_in_called_function()
+ # this was using the frame index as the return value
+ var lines =<< trim END
+ vim9script
+ au TerminalWinOpen * eval [][0]
+ def PopupTerm(a: any)
+ # make sure typvals on stack are string
+ ['a', 'b', 'c', 'd', 'e', 'f', 'g']->join()
+ FireEvent()
+ enddef
+ def FireEvent()
+ do TerminalWinOpen
+ enddef
+ # use try/catch to make eval fail
+ try
+ call PopupTerm(0)
+ catch
+ endtry
+ au! TerminalWinOpen
+ END
+ CheckScriptSuccess(lines)
+enddef
+
def Test_nested_lambda()
var lines =<< trim END
vim9script