diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-04-18 12:00:52 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-04-18 12:00:52 +0900 |
| commit | f4119f518f92ee194a13c034ee9fd57e39bb4221 (patch) | |
| tree | 53707ff5044cd9e8063d5e7edb155e9a2a67ea76 /mrbgems/mruby-compiler | |
| parent | f6c70bc6e8ea472f4d1620d38745da4be0722197 (diff) | |
| download | mruby-f4119f518f92ee194a13c034ee9fd57e39bb4221.tar.gz mruby-f4119f518f92ee194a13c034ee9fd57e39bb4221.zip | |
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.
Diffstat (limited to 'mrbgems/mruby-compiler')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 7d3785f36..4a77fb8fb 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/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(); |
