Patch 8.2.2688

5 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 1, 2021, 3:41:31 PM4/1/21
to vim...@googlegroups.com

Patch 8.2.2688
Problem: Vim9: crash when using s: for script variable.
Solution: Pass the end pointer. (closes #8045)
Files: src/vim9compile.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.2687/src/vim9compile.c 2021-04-01 19:42:43.885534865 +0200
--- src/vim9compile.c 2021-04-01 21:36:13.285708380 +0200
***************
*** 2822,2828 ****
case 'v': res = generate_LOADV(cctx, name, error);
break;
case 's': res = compile_load_scriptvar(cctx, name,
! NULL, NULL, error);
break;
case 'g': if (vim_strchr(name, AUTOLOAD_CHAR) == NULL)
isn_type = ISN_LOADG;
--- 2822,2828 ----
case 'v': res = generate_LOADV(cctx, name, error);
break;
case 's': res = compile_load_scriptvar(cctx, name,
! NULL, &end, error);
break;
case 'g': if (vim_strchr(name, AUTOLOAD_CHAR) == NULL)
isn_type = ISN_LOADG;
*** ../vim-8.2.2687/src/testdir/test_vim9_script.vim 2021-04-01 12:57:53.539273235 +0200
--- src/testdir/test_vim9_script.vim 2021-04-01 21:35:49.021774436 +0200
***************
*** 1644,1652 ****

# using the function from a compiled function
def TestMore(): string
! return anAlias.GetString('text')
enddef
! assert_equal('text', TestMore())

# error when using a function that isn't exported
assert_fails('anAlias.Compare(1, 2)', 'E1049:')
--- 1644,1653 ----

# using the function from a compiled function
def TestMore(): string
! var s = s:anAlias.GetString('foo')
! return s .. anAlias.GetString('bar')
enddef
! assert_equal('foobar', TestMore())

# error when using a function that isn't exported
assert_fails('anAlias.Compare(1, 2)', 'E1049:')
*** ../vim-8.2.2687/src/version.c 2021-04-01 19:42:43.885534865 +0200
--- src/version.c 2021-04-01 21:28:38.970849463 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2688,
/**/

--
Everybody lies, but it doesn't matter since nobody listens.
-- Lieberman's Law

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages