diff src/vim9execute.c @ 31976:16025ef158bf v9.0.1320

patch 9.0.1320: checking the type of a null object causes a crash Commit: https://github.com/vim/vim/commit/0917e867632199883c07c2d7534f7091b1d12607 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 18 14:42:44 2023 +0000 patch 9.0.1320: checking the type of a null object causes a crash Problem: Checking the type of a null object causes a crash. Solution: Don't try to get the class of a null object. (closes https://github.com/vim/vim/issues/12005) Handle error from calling a user function better.
author Bram Moolenaar <Bram@vim.org>
date Sat, 18 Feb 2023 15:45:04 +0100
parents 7b1cbb43506c
children 13329cb9faee
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1283,7 +1283,7 @@ call_ufunc(
 {
     typval_T	argvars[MAX_FUNC_ARGS];
     funcexe_T   funcexe;
-    int		error;
+    funcerror_T	error;
     int		idx;
     int		did_emsg_before = did_emsg;
     compiletype_T compile_type = get_compile_type(ufunc);
@@ -1464,10 +1464,10 @@ call_partial(
 	name = tv->vval.v_string;
     if (name != NULL)
     {
-	char_u	fname_buf[FLEN_FIXED + 1];
-	char_u	*tofree = NULL;
-	int	error = FCERR_NONE;
-	char_u	*fname;
+	char_u	    fname_buf[FLEN_FIXED + 1];
+	char_u	    *tofree = NULL;
+	funcerror_T error = FCERR_NONE;
+	char_u	    *fname;
 
 	// May need to translate <SNR>123_ to K_SNR.
 	fname = fname_trans_sid(name, fname_buf, &tofree, &error);