To: vim_dev@googlegroups.com Subject: Patch 8.2.4128 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4128 Problem: Crash when method cannot be found. (Christian J. Robinson) Solution: Don't mix up pointer names. Files: src/eval.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.4127/src/eval.c 2022-01-17 21:13:24.474867011 +0000 --- src/eval.c 2022-01-18 10:35:03.677677097 +0000 *************** *** 4050,4065 **** if (**arg != '(' && alias == NULL && (paren = vim_strchr(*arg, '(')) != NULL) { *arg = name; *paren = NUL; ! name = deref_function_name(arg, &tofree, evalarg, verbose); ! if (name == NULL) { *arg = name + len; ret = FAIL; } else len = STRLEN(name); *paren = '('; } --- 4050,4070 ---- if (**arg != '(' && alias == NULL && (paren = vim_strchr(*arg, '(')) != NULL) { + char_u *deref; + *arg = name; *paren = NUL; ! deref = deref_function_name(arg, &tofree, evalarg, verbose); ! if (deref == NULL) { *arg = name + len; ret = FAIL; } else + { + name = deref; len = STRLEN(name); + } *paren = '('; } *** ../vim-8.2.4127/src/testdir/test_vim9_expr.vim 2022-01-17 20:50:36.491316623 +0000 --- src/testdir/test_vim9_expr.vim 2022-01-18 10:35:46.481600466 +0000 *************** *** 3214,3219 **** --- 3214,3227 ---- END CheckScriptSuccess(lines) + lines =<< trim END + vim9script + import './Xsquare.vim' + + echo range(5)->Xsquare.NoSuchFunc() + END + CheckScriptFailure(lines, 'E1048: Item not found in script: NoSuchFunc') + delete('Xsquare.vim') enddef *** ../vim-8.2.4127/src/version.c 2022-01-17 22:16:29.862803979 +0000 --- src/version.c 2022-01-18 10:36:59.961471918 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4128, /**/ -- ARTHUR: I am your king! WOMAN: Well, I didn't vote for you. ARTHUR: You don't vote for kings. WOMAN: Well, 'ow did you become king then? The Quest for the Holy Grail (Monty Python) /// 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 ///