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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202104011941.131JfPxn2037028%40masaka.moolenaar.net.