forked from aniani/vim
patch 8.2.3486: illegal memory access with invalid sequence of commands
Problem: Illegal memory access with invalid sequence of commands. Solution: Do not call leave_block() when not in a try block. (closes #8966) Reset did_emsg so that exception is shown as an error.
This commit is contained in:
@@ -2295,5 +2295,25 @@ func Test_error_in_catch_and_finally()
|
||||
call delete('XtestCatchAndFinally')
|
||||
endfunc
|
||||
|
||||
" This was causing an illegal memory access
|
||||
func Test_leave_block_in_endtry_not_called()
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
try #
|
||||
for x in []
|
||||
if
|
||||
endwhile
|
||||
if
|
||||
endtry
|
||||
END
|
||||
call writefile(lines, 'XtestEndtry')
|
||||
try
|
||||
source XtestEndtry
|
||||
catch /E171:/
|
||||
endtry
|
||||
|
||||
call delete('XtestEndtry')
|
||||
endfunc
|
||||
|
||||
" Modeline {{{1
|
||||
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||
|
||||
Reference in New Issue
Block a user