• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョン34fe6aca48c27c2e9dc40fc3e67f83eb7988ed5c (tree)
日時2021-07-23 02:15:04
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.3203: Vim9: compiled string expression causes type error

Commit: https://github.com/vim/vim/commit/cd268017cf79a546a494883b4b026a3cbbd9a8a0
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 22 19:11:08 2021 +0200

patch 8.2.3203: Vim9: compiled string expression causes type error
Problem: Vim9: compiled string expression causes type error. (Yegappan
Lakshmanan)
Solution: Remove the string type from the stack.

変更サマリ

差分

diff -r c3073f1029cc -r 34fe6aca48c2 src/evalfunc.c
--- a/src/evalfunc.c Thu Jul 22 19:00:06 2021 +0200
+++ b/src/evalfunc.c Thu Jul 22 19:15:04 2021 +0200
@@ -711,6 +711,8 @@
711711 static argcheck_T arg4_strpart[] = {arg_string, arg_number, arg_number, arg_bool};
712712 static argcheck_T arg23_win_execute[] = {arg_number, arg_string_or_list_string, arg_string};
713713 static argcheck_T arg4_match_func[] = {arg_string_or_list_any, arg_string, arg_number, arg_number};
714+static argcheck_T arg15_search[] = {arg_string, arg_string, arg_number, arg_number, NULL};
715+
714716
715717 /*
716718 * Functions that return the return type of a builtin function.
@@ -1738,7 +1740,7 @@
17381740 ret_number, f_screenrow},
17391741 {"screenstring", 2, 2, FEARG_1, arg2_number,
17401742 ret_string, f_screenstring},
1741- {"search", 1, 5, FEARG_1, NULL,
1743+ {"search", 1, 5, FEARG_1, arg15_search,
17421744 ret_number, f_search},
17431745 {"searchcount", 0, 1, FEARG_1, arg1_dict_any,
17441746 ret_dict_any, f_searchcount},
diff -r c3073f1029cc -r 34fe6aca48c2 src/version.c
--- a/src/version.c Thu Jul 22 19:00:06 2021 +0200
+++ b/src/version.c Thu Jul 22 19:15:04 2021 +0200
@@ -756,6 +756,8 @@
756756 static int included_patches[] =
757757 { /* Add new patch number below this line */
758758 /**/
759+ 3203,
760+/**/
759761 3202,
760762 /**/
761763 3201,
diff -r c3073f1029cc -r 34fe6aca48c2 src/vim9compile.c
--- a/src/vim9compile.c Thu Jul 22 19:00:06 2021 +0200
+++ b/src/vim9compile.c Thu Jul 22 19:15:04 2021 +0200
@@ -3244,6 +3244,9 @@
32443244 int instr_count;
32453245 isn_T *instr = NULL;
32463246
3247+ // Remove the string type from the stack.
3248+ --cctx->ctx_type_stack.ga_len;
3249+
32473250 // Temporarily reset the list of instructions so that the jump labels are
32483251 // correct.
32493252 cctx->ctx_instr.ga_len = 0;
@@ -4263,8 +4266,8 @@
42634266 }
42644267 }
42654268
4266- // Do not skip over white space to find the "(", "execute 'x' ()" is
4267- // not a function call.
4269+ // Do not skip over white space to find the "(", "execute 'x' (expr)"
4270+ // is not a function call.
42684271 if (**arg == '(')
42694272 {
42704273 garray_T *stack = &cctx->ctx_type_stack;
旧リポジトリブラウザで表示