Should raise an exception if break called in ensure; fix #3721

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-06-23 17:58:43 +09:00
parent 7944d9a6d4
commit d0717efda6
+1 -1
View File
@@ -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) {