Mercurial > vim
diff src/proto/userfunc.pro @ 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 | ec76f9d2319e |
children | ec05de98b0f7 |
line wrap: on
line diff
--- a/src/proto/userfunc.pro +++ b/src/proto/userfunc.pro @@ -9,7 +9,7 @@ char_u *deref_func_name(char_u *name, in void emsg_funcname(char *ermsg, char_u *name); int get_func_arguments(char_u **arg, evalarg_T *evalarg, int partial_argc, typval_T *argvars, int *argcount); int get_func_tv(char_u *name, int len, typval_T *rettv, char_u **arg, evalarg_T *evalarg, funcexe_T *funcexe); -char_u *fname_trans_sid(char_u *name, char_u *fname_buf, char_u **tofree, int *error); +char_u *fname_trans_sid(char_u *name, char_u *fname_buf, char_u **tofree, funcerror_T *error); void func_name_with_sid(char_u *name, int sid, char_u *buffer); ufunc_T *find_func_even_dead(char_u *name, int flags); ufunc_T *find_func(char_u *name, int is_global); @@ -24,8 +24,8 @@ int funcdepth_get(void); void funcdepth_restore(int depth); funccall_T *create_funccal(ufunc_T *fp, typval_T *rettv); void remove_funccal(void); -int check_user_func_argcount(ufunc_T *fp, int argcount); -int call_user_func_check(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rettv, funcexe_T *funcexe, dict_T *selfdict); +funcerror_T check_user_func_argcount(ufunc_T *fp, int argcount); +funcerror_T call_user_func_check(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rettv, funcexe_T *funcexe, dict_T *selfdict); void save_funccal(funccal_entry_T *entry); void restore_funccal(void); funccall_T *get_current_funccal(void); @@ -37,7 +37,7 @@ int func_call(char_u *name, typval_T *ar int get_callback_depth(void); int call_callback(callback_T *callback, int len, typval_T *rettv, int argcount, typval_T *argvars); varnumber_T call_callback_retnr(callback_T *callback, int argcount, typval_T *argvars); -void user_func_error(int error, char_u *name, int found_var); +void user_func_error(funcerror_T error, char_u *name, int found_var); int call_func(char_u *funcname, int len, typval_T *rettv, int argcount_in, typval_T *argvars_in, funcexe_T *funcexe); int call_simple_func(char_u *funcname, int len, typval_T *rettv); char_u *printable_func_name(ufunc_T *fp);