summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-06-23 17:58:43 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-06-23 18:08:04 +0900
commitd0717efda64efba9b7b7d6602fddf797a05af196 (patch)
tree29b5cb89cdb277607b357f2712e6db5d8e383369 /mrbgems/mruby-compiler
parent7944d9a6d4ccb94189f37d307d384ed1cfe33e17 (diff)
downloadmruby-d0717efda64efba9b7b7d6602fddf797a05af196.tar.gz
mruby-d0717efda64efba9b7b7d6602fddf797a05af196.zip
Should raise an exception if `break` called in ensure; fix #3721
Diffstat (limited to 'mrbgems/mruby-compiler')
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index daf6100a3..3094ead69 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -2948,7 +2948,7 @@ loop_break(codegen_scope *s, node *tree)
genop_peep(s, MKOP_A(OP_POPERR, 1), NOVAL);
loop = loop->prev;
}
- while (loop && loop->type == LOOP_RESCUE) {
+ while (loop && (loop->type == LOOP_RESCUE || loop->type == LOOP_BEGIN)) {
loop = loop->prev;
}
if (!loop) {