1
0
forked from aniani/vim

patch 8.2.0224: compiling :elseif not tested yet

Problem:    compiling :elseif not tested yet.
Solution:   Add test for :elseif.  Fix generating jumps.
This commit is contained in:
Bram Moolenaar
2020-02-06 20:39:45 +01:00
parent 5cab73f8cc
commit 158906cffc
4 changed files with 79 additions and 26 deletions

View File

@@ -3891,7 +3891,7 @@ compile_elseif(char_u *arg, cctx_T *cctx)
}
cctx->ctx_locals.ga_len = scope->se_local_count;
if (cctx->ctx_skip != TRUE)
if (cctx->ctx_skip == MAYBE)
{
if (compile_jump_to_end(&scope->se_u.se_if.is_end_label,
JUMP_ALWAYS, cctx) == FAIL)
@@ -3947,13 +3947,14 @@ compile_else(char_u *arg, cctx_T *cctx)
return NULL;
}
if (cctx->ctx_skip != TRUE)
if (cctx->ctx_skip == MAYBE)
{
if (scope->se_u.se_if.is_if_label >= 0)
{
// previous "if" or "elseif" jumps here
isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label;
isn->isn_arg.jump.jump_where = instr->ga_len;
scope->se_u.se_if.is_if_label = -1;
}
}