patch 8.2.4426: map() function on string and blob does not check types
Problem: map() function on string and blob does not check argument types at
compile time.
Solution: Check string and blob argument types. Support "0z1234->func()".
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 86e5d2f..ce51fc0 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -566,9 +566,11 @@
t_func_exp.tt_argcount = -1;
else
{
- if (context->arg_types[0].type_decl->tt_type == VAR_LIST)
+ if (context->arg_types[0].type_curr->tt_type == VAR_STRING
+ || context->arg_types[0].type_curr->tt_type == VAR_BLOB
+ || context->arg_types[0].type_curr->tt_type == VAR_LIST)
args[0] = &t_number;
- else if (context->arg_types[0].type_decl->tt_type == VAR_DICT)
+ else if (context->arg_types[0].type_curr->tt_type == VAR_DICT)
args[0] = &t_string;
if (args[0] != NULL)
args[1] = expected_ret;