changeset 19217:1235c26d9f04 v8.2.0167

patch 8.2.0167: Coverity warning for ignoring return value Commit: https://github.com/vim/vim/commit/58ceca5cae75ed839b20a89c5fa9998f02552f58 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 28 22:46:22 2020 +0100 patch 8.2.0167: Coverity warning for ignoring return value Problem: Coverity warning for ignoring return value. Solution: Check the return value and jump if failed.
author Bram Moolenaar <Bram@vim.org>
date Tue, 28 Jan 2020 23:00:03 +0100
parents ee5cec77b9f0
children 4d35e5111ee6
files src/testdir/test_vim9_expr.vim src/version.c src/vim9execute.c
diffstat 3 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -687,6 +687,8 @@ func Test_expr7_fails()
 
   call CheckDefFailure("let x = @", "E1002:")
   call CheckDefFailure("let x = @<", "E354:")
+
+  call CheckDefFailure("let x = &notexist", "E113:")
 endfunc
 
 let g:Funcrefs = [function('add')]
--- a/src/version.c
+++ b/src/version.c
@@ -743,6 +743,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    167,
+/**/
     166,
 /**/
     165,
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -556,7 +556,8 @@ call_def_function(
 
 		    if (ga_grow(&ectx.ec_stack, 1) == FAIL)
 			goto failed;
-		    get_option_tv(&name, &optval, TRUE);
+		    if (get_option_tv(&name, &optval, TRUE) == FAIL)
+			goto failed;
 		    *STACK_TV_BOT(0) = optval;
 		    ++ectx.ec_stack.ga_len;
 		}