• R/O
  • SSH

vim: コミット

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


コミットメタ情報

リビジョンd4f254d02d7c32b81ad335d4726722aa8f6cc0ac (tree)
日時2022-01-18 19:45:04
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.4128: crash when method cannot be found

Commit: https://github.com/vim/vim/commit/64283d5e1f5487e2dbaa17d478e6eae040daa064
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 18 10:37:29 2022 +0000

patch 8.2.4128: crash when method cannot be found
Problem: Crash when method cannot be found. (Christian J. Robinson)
Solution: Don't mix up pointer names.

変更サマリ

差分

diff -r ebfde3a7b387 -r d4f254d02d7c src/eval.c
--- a/src/eval.c Mon Jan 17 23:30:03 2022 +0100
+++ b/src/eval.c Tue Jan 18 11:45:04 2022 +0100
@@ -4050,16 +4050,21 @@
40504050 if (**arg != '(' && alias == NULL
40514051 && (paren = vim_strchr(*arg, '(')) != NULL)
40524052 {
4053+ char_u *deref;
4054+
40534055 *arg = name;
40544056 *paren = NUL;
4055- name = deref_function_name(arg, &tofree, evalarg, verbose);
4056- if (name == NULL)
4057+ deref = deref_function_name(arg, &tofree, evalarg, verbose);
4058+ if (deref == NULL)
40574059 {
40584060 *arg = name + len;
40594061 ret = FAIL;
40604062 }
40614063 else
4064+ {
4065+ name = deref;
40624066 len = STRLEN(name);
4067+ }
40634068 *paren = '(';
40644069 }
40654070
diff -r ebfde3a7b387 -r d4f254d02d7c src/testdir/test_vim9_expr.vim
--- a/src/testdir/test_vim9_expr.vim Mon Jan 17 23:30:03 2022 +0100
+++ b/src/testdir/test_vim9_expr.vim Tue Jan 18 11:45:04 2022 +0100
@@ -3214,6 +3214,14 @@
32143214 END
32153215 CheckScriptSuccess(lines)
32163216
3217+ lines =<< trim END
3218+ vim9script
3219+ import './Xsquare.vim'
3220+
3221+ echo range(5)->Xsquare.NoSuchFunc()
3222+ END
3223+ CheckScriptFailure(lines, 'E1048: Item not found in script: NoSuchFunc')
3224+
32173225 delete('Xsquare.vim')
32183226 enddef
32193227
diff -r ebfde3a7b387 -r d4f254d02d7c src/version.c
--- a/src/version.c Mon Jan 17 23:30:03 2022 +0100
+++ b/src/version.c Tue Jan 18 11:45:04 2022 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 4128,
755+/**/
754756 4127,
755757 /**/
756758 4126,
旧リポジトリブラウザで表示