Problem: Vim9: Crash with :execute and :finish. (Sergey Vlasov)
Solution: Check for NULL. (closes #10011)
p = skipwhite(next);
if (*p != NUL && !vim9_comment_start(p))
return next;
- (void)eval_next_line(evalarg);
+ if (eval_next_line(evalarg) == NULL)
+ break;
}
return NULL;
}
GETLINE_CONCAT_ALL);
else
line = next_line_from_context(evalarg->eval_cctx, TRUE);
+ if (line == NULL)
+ return NULL;
+
++evalarg->eval_break_count;
if (gap->ga_itemsize > 0 && ga_grow(gap, 1) == OK)
{
v9.CheckScriptSuccess(lines)
enddef
+def Test_execute_finish()
+ # the empty lines are relevant here
+ var lines =<< trim END
+ vim9script
+
+ var vname = "g:hello"
+
+ if exists(vname) | finish | endif | execute vname '= "world"'
+
+ assert_equal('world', g:hello)
+
+ if exists(vname) | finish | endif | execute vname '= "world"'
+
+ assert_report('should not be reached')
+ END
+ v9.CheckScriptSuccess(lines)
+enddef
+
def Test_echo_cmd()
echo 'some' # comment
echon 'thing'
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4622,
/**/
4621,
/**/