diff src/vim.h @ 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 c5ff7d053fa1
children ca6bc7c04163
line wrap: on
line diff
--- a/src/vim.h
+++ b/src/vim.h
@@ -2270,6 +2270,20 @@ typedef enum {
     KEYPROTOCOL_FAIL
 } keyprot_T;
 
+// errors for when calling a function
+typedef enum {
+    FCERR_NONE,		// no error
+    FCERR_UNKNOWN,	// unknown function
+    FCERR_TOOMANY,	// too many arguments
+    FCERR_TOOFEW,	// too few arguments
+    FCERR_SCRIPT,	// missing script context
+    FCERR_DICT,		// missing dict
+    FCERR_OTHER,	// another kind of error
+    FCERR_DELETED,	// function was deleted
+    FCERR_NOTMETHOD,	// function cannot be used as a method
+    FCERR_FAILED,	// error while executing the function
+} funcerror_T;
+
 // Flags for assignment functions.
 #define ASSIGN_VAR	0     // ":var" (nothing special)
 #define ASSIGN_FINAL	0x01  // ":final"
@@ -2703,17 +2717,6 @@ typedef enum {
 #define DO_NOT_FREE_CNT 99999	// refcount for dict or list that should not
 				// be freed.
 
-// errors for when calling a function
-#define FCERR_UNKNOWN	0
-#define FCERR_TOOMANY	1
-#define FCERR_TOOFEW	2
-#define FCERR_SCRIPT	3
-#define FCERR_DICT	4
-#define FCERR_NONE	5
-#define FCERR_OTHER	6
-#define FCERR_DELETED	7
-#define FCERR_NOTMETHOD	8   // function cannot be used as a method
-
 // fixed buffer length for fname_trans_sid()
 #define FLEN_FIXED 40