mirror of
https://github.com/vim/vim.git
synced 2025-11-15 23:14:06 -05:00
patch 9.0.2169: Vim9: builtin funcs may accept a non-value
Problem: Vim9: builtin funcs may accept a non-value Solution: Restrict builtin functions that accept `type` This PR finishes off detection and prevention of using a type as a value. It takes care of builtin functions. However there are some builtin functions, that need to be able to handle types as well as non-args: instanceof(), type(), typename(), string(). A "bit", FE_X, is added to funcentry_T; when set, the builtin function can handle a type (class or type-alias) in addition to a value. Noteworthy change: Discovered that in compile_call() the builtin add() is compiled inline instead of calling the builtin. Had to add a check there. closes: #13688 Signed-off-by: Ernie Rael <errael@raelity.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
df12e39b8b
commit
d8bf87c9fb
@@ -36,7 +36,6 @@ type_T *get_member_type_from_stack(int count, int skip, cctx_T *cctx);
|
||||
char *vartype_name(vartype_T type);
|
||||
char *type_name(type_T *type, char **tofree);
|
||||
void f_typename(typval_T *argvars, typval_T *rettv);
|
||||
int check_vartype_is_value(vartype_T typ);
|
||||
int check_typval_is_value(typval_T *tv);
|
||||
int check_type_is_value(type_T *type);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
Reference in New Issue
Block a user