Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
31975:eed95e0f92ff | 31976:16025ef158bf |
---|---|
2268 KEYPROTOCOL_MOK2, | 2268 KEYPROTOCOL_MOK2, |
2269 KEYPROTOCOL_KITTY, | 2269 KEYPROTOCOL_KITTY, |
2270 KEYPROTOCOL_FAIL | 2270 KEYPROTOCOL_FAIL |
2271 } keyprot_T; | 2271 } keyprot_T; |
2272 | 2272 |
2273 // errors for when calling a function | |
2274 typedef enum { | |
2275 FCERR_NONE, // no error | |
2276 FCERR_UNKNOWN, // unknown function | |
2277 FCERR_TOOMANY, // too many arguments | |
2278 FCERR_TOOFEW, // too few arguments | |
2279 FCERR_SCRIPT, // missing script context | |
2280 FCERR_DICT, // missing dict | |
2281 FCERR_OTHER, // another kind of error | |
2282 FCERR_DELETED, // function was deleted | |
2283 FCERR_NOTMETHOD, // function cannot be used as a method | |
2284 FCERR_FAILED, // error while executing the function | |
2285 } funcerror_T; | |
2286 | |
2273 // Flags for assignment functions. | 2287 // Flags for assignment functions. |
2274 #define ASSIGN_VAR 0 // ":var" (nothing special) | 2288 #define ASSIGN_VAR 0 // ":var" (nothing special) |
2275 #define ASSIGN_FINAL 0x01 // ":final" | 2289 #define ASSIGN_FINAL 0x01 // ":final" |
2276 #define ASSIGN_CONST 0x02 // ":const" | 2290 #define ASSIGN_CONST 0x02 // ":const" |
2277 #define ASSIGN_NO_DECL 0x04 // "name = expr" without ":let"/":const"/":final" | 2291 #define ASSIGN_NO_DECL 0x04 // "name = expr" without ":let"/":const"/":final" |
2701 #define GLV_ASSIGN_WITH_OP TFN_ASSIGN_WITH_OP // assignment with operator | 2715 #define GLV_ASSIGN_WITH_OP TFN_ASSIGN_WITH_OP // assignment with operator |
2702 | 2716 |
2703 #define DO_NOT_FREE_CNT 99999 // refcount for dict or list that should not | 2717 #define DO_NOT_FREE_CNT 99999 // refcount for dict or list that should not |
2704 // be freed. | 2718 // be freed. |
2705 | 2719 |
2706 // errors for when calling a function | |
2707 #define FCERR_UNKNOWN 0 | |
2708 #define FCERR_TOOMANY 1 | |
2709 #define FCERR_TOOFEW 2 | |
2710 #define FCERR_SCRIPT 3 | |
2711 #define FCERR_DICT 4 | |
2712 #define FCERR_NONE 5 | |
2713 #define FCERR_OTHER 6 | |
2714 #define FCERR_DELETED 7 | |
2715 #define FCERR_NOTMETHOD 8 // function cannot be used as a method | |
2716 | |
2717 // fixed buffer length for fname_trans_sid() | 2720 // fixed buffer length for fname_trans_sid() |
2718 #define FLEN_FIXED 40 | 2721 #define FLEN_FIXED 40 |
2719 | 2722 |
2720 // flags for find_name_end() | 2723 // flags for find_name_end() |
2721 #define FNE_INCL_BR 1 // include [] in name | 2724 #define FNE_INCL_BR 1 // include [] in name |