summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index b2770c3221..e09e828c6f 100644
--- a/compile.c
+++ b/compile.c
@@ -5771,7 +5771,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp
const rb_iseq_t *parent_iseq = is->body->parent_iseq;
enum iseq_type parent_type;
- if (type == ISEQ_TYPE_TOP || type == ISEQ_TYPE_MAIN) {
+ if (type == ISEQ_TYPE_TOP) {
LABEL *splabel = NEW_LABEL(line);
ADD_LABEL(ret, splabel);
ADD_ADJUST(ret, line, 0);
@@ -5779,7 +5779,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp
ADD_INSN(ret, line, leave);
ADD_ADJUST_RESTORE(ret, splabel);
}
- else if ((type == ISEQ_TYPE_RESCUE || type == ISEQ_TYPE_ENSURE) &&
+ else if ((type == ISEQ_TYPE_RESCUE || type == ISEQ_TYPE_ENSURE || type == ISEQ_TYPE_MAIN) &&
parent_iseq &&
((parent_type = parent_iseq->body->type) == ISEQ_TYPE_TOP ||
parent_type == ISEQ_TYPE_MAIN)) {