]> granicus.if.org Git - vim/commitdiff
patch 8.1.1491: when skipping over code a function call may cause trouble v8.1.1491
authorBram Moolenaar <Bram@vim.org>
Fri, 7 Jun 2019 21:15:22 +0000 (23:15 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 7 Jun 2019 21:15:22 +0000 (23:15 +0200)
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)

src/eval.c
src/testdir/test_eval_stuff.vim
src/version.c

index abb3b40692358459c17b6c8e4c48e08bb9c87e88..c86d0a6646e770f2a58eb002361f964977c7bd90 100644 (file)
@@ -4592,7 +4592,7 @@ eval7(
                /* Stop the expression evaluation when immediately
                 * aborting on error, or when an interrupt occurred or
                 * an exception was thrown but not caught. */
-               if (aborting())
+               if (evaluate && aborting())
                {
                    if (ret == OK)
                        clear_tv(rettv);
index c7797233918c8fdbe8ae807db8fe8b571cbd16a0..db68e2a40292c5731b285ab0c10d2578ccce7fa1 100644 (file)
@@ -178,3 +178,12 @@ func Test_scriptversion()
   call assert_fails('source Xversionscript', 'E999:')
   call delete('Xversionscript')
 endfunc
+
+" Test fix for issue #4507
+func Test_skip_after_throw()
+  try
+    throw 'something'
+    let x = wincol() || &ts
+  catch /something/
+  endtry
+endfunc
index 75ebdc1edce8f4ab3c509f7bcdea7d457498c318..79d040037f3f4da53f9174991bade3ca5064cce1 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1491,
 /**/
     1490,
 /**/