aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-10 08:34:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-10 08:34:18 +0000
commitcf09c0c351d15968819bbe73a5a9d9dc41a3e0d9 (patch)
tree94a8ce38dab0243bb6e6133bd66fc95a1b5e82af /iseq.c
parent2d39d11436b5cae57f8d87e424f9f30bb97b7e20 (diff)
downloadruby-cf09c0c351d15968819bbe73a5a9d9dc41a3e0d9.tar.gz
iseq.h: coverage_enabled flag
* iseq.c (prepare_iseq_build): enable coverage by coverage_enabled option, not by parse_in_eval flag in the thread context. * iseq.h (rb_compile_option_struct): add coverage_enabled flag. * parse.y (yycompile0): set coverage_enabled flag if coverage array is made. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/iseq.c b/iseq.c
index e0a33d6288..01e6d44add 100644
--- a/iseq.c
+++ b/iseq.c
@@ -298,7 +298,7 @@ prepare_iseq_build(rb_iseq_t *iseq,
ISEQ_COMPILE_DATA(iseq)->option = option;
ISEQ_COMPILE_DATA(iseq)->last_coverable_line = -1;
- if (!GET_THREAD()->parse_in_eval) {
+ if (option->coverage_enabled) {
VALUE coverages = rb_get_coverages();
if (RTEST(coverages)) {
coverage = rb_hash_lookup(coverages, path);
@@ -336,6 +336,7 @@ static rb_compile_option_t COMPILE_OPTION_DEFAULT = {
OPT_TRACE_INSTRUCTION, /* int trace_instruction */
OPT_FROZEN_STRING_LITERAL,
OPT_DEBUG_FROZEN_STRING_LITERAL,
+ TRUE, /* coverage_enabled */
};
static const rb_compile_option_t COMPILE_OPTION_FALSE = {0};
@@ -362,6 +363,7 @@ set_compile_option_from_hash(rb_compile_option_t *option, VALUE opt)
SET_COMPILE_OPTION(option, opt, trace_instruction);
SET_COMPILE_OPTION(option, opt, frozen_string_literal);
SET_COMPILE_OPTION(option, opt, debug_frozen_string_literal);
+ SET_COMPILE_OPTION(option, opt, coverage_enabled);
SET_COMPILE_OPTION_NUM(option, opt, debug_level);
#undef SET_COMPILE_OPTION
#undef SET_COMPILE_OPTION_NUM
@@ -416,6 +418,7 @@ make_compile_option_value(rb_compile_option_t *option)
SET_COMPILE_OPTION(option, opt, trace_instruction);
SET_COMPILE_OPTION(option, opt, frozen_string_literal);
SET_COMPILE_OPTION(option, opt, debug_frozen_string_literal);
+ SET_COMPILE_OPTION(option, opt, coverage_enabled);
SET_COMPILE_OPTION_NUM(option, opt, debug_level);
}
#undef SET_COMPILE_OPTION