# HG changeset patch # User Bram Moolenaar # Date 1617306302 -7200 # Node ID 7f634eae21fe85f633a0f4156964dc5b59503c1d # Parent e4dddd2b4a503649fa426b94bb27a63a4f054e87 patch 8.2.2688: Vim9: crash when using s: for script variable Commit: https://github.com/vim/vim/commit/ca51cc0a335d0c449784440501c7d46ee8f84ce4 Author: Bram Moolenaar Date: Thu Apr 1 21:38:53 2021 +0200 patch 8.2.2688: Vim9: crash when using s: for script variable Problem: Vim9: crash when using s: for script variable. Solution: Pass the end pointer. (closes https://github.com/vim/vim/issues/8045) diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1644,9 +1644,10 @@ def Test_vim9script_funcref() # using the function from a compiled function def TestMore(): string - return anAlias.GetString('text') + var s = s:anAlias.GetString('foo') + return s .. anAlias.GetString('bar') enddef - assert_equal('text', TestMore()) + assert_equal('foobar', TestMore()) # error when using a function that isn't exported assert_fails('anAlias.Compare(1, 2)', 'E1049:') diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2688, +/**/ 2687, /**/ 2686, diff --git a/src/vim9compile.c b/src/vim9compile.c --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -2822,7 +2822,7 @@ compile_load( case 'v': res = generate_LOADV(cctx, name, error); break; case 's': res = compile_load_scriptvar(cctx, name, - NULL, NULL, error); + NULL, &end, error); break; case 'g': if (vim_strchr(name, AUTOLOAD_CHAR) == NULL) isn_type = ISN_LOADG;