Permalink
Browse files

Changed evaluation order of `yield`; ref #3613

So that `yield expr_with_error` will cause the error from the
argument rather than `LocalJumpError` when no block is given.
  • Loading branch information...
matz committed Apr 18, 2017
1 parent f6c70bc commit f4119f518f92ee194a13c034ee9fd57e39bb4221
Showing with 1 addition and 1 deletion.
  1. +1 −1 mrbgems/mruby-compiler/core/codegen.c
@@ -2017,7 +2017,6 @@ codegen(codegen_scope *s, node *tree, int val)
if (!s2) break;
}
if (s2) ainfo = s2->ainfo;
genop(s, MKOP_ABx(OP_BLKPUSH, cursp(), (ainfo<<4)|(lv & 0xf)));
push();
if (tree) {
n = gen_values(s, tree, VAL, 0);
@@ -2027,6 +2026,7 @@ codegen(codegen_scope *s, node *tree, int val)
}
}
pop_n(n+1);
genop(s, MKOP_ABx(OP_BLKPUSH, cursp(), (ainfo<<4)|(lv & 0xf)));
if (sendv) n = CALL_MAXARGS;
genop(s, MKOP_ABC(OP_SEND, cursp(), new_msym(s, mrb_intern_lit(s->mrb, "call")), n));
if (val) push();

0 comments on commit f4119f5

Please sign in to comment.