# HG changeset patch # User Bram Moolenaar # Date 1627126204 -7200 # Node ID 37001467805f6e4910059f361593f6f47f095e49 # Parent 5f0765ae6ad9a97ab3406a9974b2b529f37d1aa6 patch 8.2.3207: Vim9: crash when compiling string fails Commit: https://github.com/vim/vim/commit/5a234eb18e6e43408755bb24e813330306c11629 Author: Bram Moolenaar Date: Sat Jul 24 13:18:48 2021 +0200 patch 8.2.3207: Vim9: crash when compiling string fails Problem: Vim9: crash when compiling string fails. (Yegappan Lakshmanan) Solution: Adjust the type stack length. diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -2566,8 +2566,13 @@ def Test_searchpair() END CheckScriptSuccess(lines) assert_equal('yes', g:caught) - unlet g:caught + + lines =<< trim END + echo searchpair("a", "b", "c", "d", "1", "f") + END + CheckDefAndScriptFailure2(lines, 'E1001:', 'E475:') + bwipe! enddef diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3207, +/**/ 3206, /**/ 3205, diff --git a/src/vim9compile.c b/src/vim9compile.c --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -3263,6 +3263,7 @@ compile_string(isn_T *isn, cctx_T *cctx) semsg(_(e_trailing_arg), s); clear_instr_ga(&cctx->ctx_instr); cctx->ctx_instr = save_ga; + ++cctx->ctx_type_stack.ga_len; return FAIL; }