patch 8.2.0224: compiling :elseif not tested yet
Problem: compiling :elseif not tested yet.
Solution: Add test for :elseif. Fix generating jumps.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 922618b..1c76c8a 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3891,7 +3891,7 @@
}
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 @@
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;
}
}