Problem: Crash when :def function has :break in skipped block. (Ernie Rael)
Solution: Don't generate a jump for a skipped :break. (closes #12077)
delfunc g:Define
enddef
+def Test_break_in_skipped_block()
+ var lines =<< trim END
+ vim9script
+
+ def FixStackFrame(): string
+ for _ in [2]
+ var path = 'xxx'
+ if !!path
+ if false
+ break
+ else
+ return 'foo'
+ endif
+ endif
+ endfor
+ return 'xxx'
+ enddef
+
+ disas FixStackFrame
+
+ FixStackFrame()
+ END
+ v9.CheckScriptSuccess(lines)
+enddef
+
def Test_autoload_name_mismatch()
var dir = 'Xnamedir/autoload'
mkdir(dir, 'pR')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1363,
/**/
1362,
/**/
e_break_without_while_or_for, cctx) == FAIL)
return NULL;
+ if (cctx->ctx_skip == SKIP_YES)
+ return arg;
+
if (try_scopes > 0)
// Inside one or more try/catch blocks we first need to jump to the
// "finally" or "endtry" to cleanup. Then come to the next JUMP
// Jump to the end of the FOR or WHILE loop. The instruction index will be
// filled in later.
if (compile_jump_to_end(el, JUMP_ALWAYS, 0, cctx) == FAIL)
- return FAIL;
+ return NULL;
return arg;
}