mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.2.1191: Vim9: crash when function calls itself
Problem: Vim9: crash when function calls itself. Solution: Add status UF_COMPILING. (closes #6441)
This commit is contained in:
@@ -999,5 +999,17 @@ func Test_silent_echo()
|
||||
call delete('XTest_silent_echo')
|
||||
endfunc
|
||||
|
||||
def Fibonacci(n: number): number
|
||||
if n < 2
|
||||
return n
|
||||
else
|
||||
return Fibonacci(n - 1) + Fibonacci(n - 2)
|
||||
endif
|
||||
enddef
|
||||
|
||||
def Test_recursive_call()
|
||||
assert_equal(6765, Fibonacci(20))
|
||||
enddef
|
||||
|
||||
|
||||
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||
|
Reference in New Issue
Block a user