0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.1.1491: when skipping over code a function call may cause trouble

Problem:    When skipping over code after an exception was thrown expression
            evaluation is aborted after a function call. (Ingo Karkat)
Solution:   Do not fail if not executing the expression. (closes #4507)
This commit is contained in:
Bram Moolenaar
2019-06-07 23:15:22 +02:00
parent 4e0bf84627
commit 6064073841
3 changed files with 12 additions and 1 deletions

View File

@@ -4592,7 +4592,7 @@ eval7(
/* Stop the expression evaluation when immediately /* Stop the expression evaluation when immediately
* aborting on error, or when an interrupt occurred or * aborting on error, or when an interrupt occurred or
* an exception was thrown but not caught. */ * an exception was thrown but not caught. */
if (aborting()) if (evaluate && aborting())
{ {
if (ret == OK) if (ret == OK)
clear_tv(rettv); clear_tv(rettv);

View File

@@ -178,3 +178,12 @@ func Test_scriptversion()
call assert_fails('source Xversionscript', 'E999:') call assert_fails('source Xversionscript', 'E999:')
call delete('Xversionscript') call delete('Xversionscript')
endfunc endfunc
" Test fix for issue #4507
func Test_skip_after_throw()
try
throw 'something'
let x = wincol() || &ts
catch /something/
endtry
endfunc

View File

@@ -767,6 +767,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1491,
/**/ /**/
1490, 1490,
/**/ /**/