0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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.
This commit is contained in:
Bram Moolenaar
2021-07-24 13:18:48 +02:00
parent 0ad871dc4d
commit 5a234eb18e
3 changed files with 9 additions and 1 deletions

View File

@@ -2566,8 +2566,13 @@ def Test_searchpair()
END END
CheckScriptSuccess(lines) CheckScriptSuccess(lines)
assert_equal('yes', g:caught) assert_equal('yes', g:caught)
unlet g:caught unlet g:caught
lines =<< trim END
echo searchpair("a", "b", "c", "d", "1", "f")
END
CheckDefAndScriptFailure2(lines, 'E1001:', 'E475:')
bwipe! bwipe!
enddef enddef

View File

@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3207,
/**/ /**/
3206, 3206,
/**/ /**/

View File

@@ -3263,6 +3263,7 @@ compile_string(isn_T *isn, cctx_T *cctx)
semsg(_(e_trailing_arg), s); semsg(_(e_trailing_arg), s);
clear_instr_ga(&cctx->ctx_instr); clear_instr_ga(&cctx->ctx_instr);
cctx->ctx_instr = save_ga; cctx->ctx_instr = save_ga;
++cctx->ctx_type_stack.ga_len;
return FAIL; return FAIL;
} }