To: vim_dev@googlegroups.com Subject: Patch 8.2.3203 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3203 Problem: Vim9: compiled string expression causes type error. (Yegappan Lakshmanan) Solution: Remove the string type from the stack. Files: src/vim9compile.c, src/evalfunc.c *** ../vim-8.2.3202/src/vim9compile.c 2021-07-22 14:58:43.473967313 +0200 --- src/vim9compile.c 2021-07-22 19:09:32.432874656 +0200 *************** *** 3244,3249 **** --- 3244,3252 ---- int instr_count; isn_T *instr = NULL; + // Remove the string type from the stack. + --cctx->ctx_type_stack.ga_len; + // Temporarily reset the list of instructions so that the jump labels are // correct. cctx->ctx_instr.ga_len = 0; *************** *** 4263,4270 **** } } ! // Do not skip over white space to find the "(", "execute 'x' ()" is ! // not a function call. if (**arg == '(') { garray_T *stack = &cctx->ctx_type_stack; --- 4266,4273 ---- } } ! // Do not skip over white space to find the "(", "execute 'x' (expr)" ! // is not a function call. if (**arg == '(') { garray_T *stack = &cctx->ctx_type_stack; *** ../vim-8.2.3202/src/evalfunc.c 2021-07-21 19:09:06.248680063 +0200 --- src/evalfunc.c 2021-07-22 19:02:14.329964627 +0200 *************** *** 711,716 **** --- 711,718 ---- static argcheck_T arg4_strpart[] = {arg_string, arg_number, arg_number, arg_bool}; static argcheck_T arg23_win_execute[] = {arg_number, arg_string_or_list_string, arg_string}; static argcheck_T arg4_match_func[] = {arg_string_or_list_any, arg_string, arg_number, arg_number}; + static argcheck_T arg15_search[] = {arg_string, arg_string, arg_number, arg_number, NULL}; + /* * Functions that return the return type of a builtin function. *************** *** 1738,1744 **** ret_number, f_screenrow}, {"screenstring", 2, 2, FEARG_1, arg2_number, ret_string, f_screenstring}, ! {"search", 1, 5, FEARG_1, NULL, ret_number, f_search}, {"searchcount", 0, 1, FEARG_1, arg1_dict_any, ret_dict_any, f_searchcount}, --- 1740,1746 ---- ret_number, f_screenrow}, {"screenstring", 2, 2, FEARG_1, arg2_number, ret_string, f_screenstring}, ! {"search", 1, 5, FEARG_1, arg15_search, ret_number, f_search}, {"searchcount", 0, 1, FEARG_1, arg1_dict_any, ret_dict_any, f_searchcount}, *** ../vim-8.2.3202/src/version.c 2021-07-22 18:48:45.460351441 +0200 --- src/version.c 2021-07-22 19:08:22.989043483 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3203, /**/ -- "You mean there really is an answer?" "Yes! But you're not going to like it!" "Oh do please tell us!" "You're really not going to like it!" "but we MUST know - tell us" "Alright, the answer is...." "yes..." "... is ..." "yes... come on!" "is 42!" (Douglas Adams - The Hitchhiker's Guide to the Galaxy) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///