0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

patch 8.2.4541: Crash in debugger when a variable is not available

Problem:    Crash in debugger when a variable is not available in the current
            block.
Solution:   Check for a NULL name. (closes #9926)
This commit is contained in:
Bram Moolenaar
2022-03-10 20:47:43 +00:00
parent 1b1df95f1a
commit e406ff87c8
3 changed files with 21 additions and 1 deletions

View File

@@ -73,6 +73,13 @@ func Test_Debugger()
endtry
return var1
endfunc
def Vim9Func()
for cmd in ['confirm', 'xxxxxxx']
for _ in [1, 2]
echo cmd
endfor
endfor
enddef
END
call writefile(lines, 'Xtest.vim')
@@ -298,6 +305,14 @@ func Test_Debugger()
\ 'line 5: catch'])
call RunDbgCmd(buf, 'c')
" Test showing local variable in :def function
call RunDbgCmd(buf, ':breakadd func 2 Vim9Func')
call RunDbgCmd(buf, ':call Vim9Func()', ['line 2: for _ in [1, 2]'])
call RunDbgCmd(buf, 'next', ['line 2: for _ in [1, 2]'])
call RunDbgCmd(buf, 'echo cmd', ['confirm'])
call RunDbgCmd(buf, 'breakdel *')
call RunDbgCmd(buf, 'cont')
" Test for :quit
call RunDbgCmd(buf, ':debug echo Foo()')
call RunDbgCmd(buf, 'breakdel *')