summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 44cb8025e8..c75e233251 100644
--- a/compile.c
+++ b/compile.c
@@ -6295,14 +6295,17 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
}
case NODE_PRELUDE:{
const rb_compile_option_t *orig_opt = ISEQ_COMPILE_DATA(iseq)->option;
+ VALUE orig_cov = ISEQ_COVERAGE(iseq);
+ rb_compile_option_t new_opt = *orig_opt;
if (node->nd_orig) {
- rb_compile_option_t new_opt = *orig_opt;
rb_iseq_make_compile_option(&new_opt, node->nd_orig);
ISEQ_COMPILE_DATA(iseq)->option = &new_opt;
}
+ if (!new_opt.coverage_enabled) ISEQ_COVERAGE_SET(iseq, Qfalse);
CHECK(COMPILE_POPPED(ret, "prelude", node->nd_head));
CHECK(COMPILE_(ret, "body", node->nd_body, popped));
ISEQ_COMPILE_DATA(iseq)->option = orig_opt;
+ ISEQ_COVERAGE_SET(iseq, orig_cov);
break;
}
case NODE_LAMBDA:{