comparison src/userfunc.c @ 24422:41cf1155ab90 v8.2.2751

patch 8.2.2751: Coverity warns for using NULL pointer Commit: https://github.com/vim/vim/commit/fed9e830fcffa90cf73dd125a27d27ed7eafbd68 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 10 21:38:38 2021 +0200 patch 8.2.2751: Coverity warns for using NULL pointer Problem: Coverity warns for using NULL pointer. Solution: Check for NULL in calling function.
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Apr 2021 21:45:03 +0200
parents 0e0943dfdbf9
children ccdd5e9a3763
comparison
equal deleted inserted replaced
24421:8ce7f56493bd 24422:41cf1155ab90
971 garray_T *argtypes, 971 garray_T *argtypes,
972 int varargs, 972 int varargs,
973 garray_T *default_args, 973 garray_T *default_args,
974 char_u *ret_type) 974 char_u *ret_type)
975 { 975 {
976 int evaluate = evalarg != NULL 976 int evaluate = (evalarg->eval_flags & EVAL_EVALUATE);
977 && (evalarg->eval_flags & EVAL_EVALUATE);
978 ufunc_T *ufunc = NULL; 977 ufunc_T *ufunc = NULL;
979 exarg_T eap; 978 exarg_T eap;
980 garray_T newlines; 979 garray_T newlines;
981 char_u *cmdline = NULL; 980 char_u *cmdline = NULL;
982 int ret = FAIL; 981 int ret = FAIL;
1178 *arg = skipwhite_and_linebreak(*arg, evalarg); 1177 *arg = skipwhite_and_linebreak(*arg, evalarg);
1179 1178
1180 // Recognize "{" as the start of a function body. 1179 // Recognize "{" as the start of a function body.
1181 if (equal_arrow && **arg == '{') 1180 if (equal_arrow && **arg == '{')
1182 { 1181 {
1182 if (evalarg == NULL)
1183 // cannot happen?
1184 goto theend;
1183 if (lambda_function_body(arg, rettv, evalarg, pnewargs, 1185 if (lambda_function_body(arg, rettv, evalarg, pnewargs,
1184 types_optional ? &argtypes : NULL, varargs, 1186 types_optional ? &argtypes : NULL, varargs,
1185 &default_args, ret_type) == FAIL) 1187 &default_args, ret_type) == FAIL)
1186 goto errret; 1188 goto errret;
1187 goto theend; 1189 goto theend;