Skip to content

Commit 5a234eb

Browse files
committed
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.
1 parent 0ad871d commit 5a234eb

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/testdir/test_vim9_builtin.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2566,8 +2566,13 @@ def Test_searchpair()
25662566
END
25672567
CheckScriptSuccess(lines)
25682568
assert_equal('yes', g:caught)
2569-
25702569
unlet g:caught
2570+
2571+
lines =<< trim END
2572+
echo searchpair("a", "b", "c", "d", "1", "f")
2573+
END
2574+
CheckDefAndScriptFailure2(lines, 'E1001:', 'E475:')
2575+
25712576
bwipe!
25722577
enddef
25732578

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3207,
758760
/**/
759761
3206,
760762
/**/

src/vim9compile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,6 +3263,7 @@ compile_string(isn_T *isn, cctx_T *cctx)
32633263
semsg(_(e_trailing_arg), s);
32643264
clear_instr_ga(&cctx->ctx_instr);
32653265
cctx->ctx_instr = save_ga;
3266+
++cctx->ctx_type_stack.ga_len;
32663267
return FAIL;
32673268
}
32683269

0 commit comments

Comments
 (0)