aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-10 05:32:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-10 05:32:49 +0000
commit9871d88ee4b73bc4685f011b77b97228b03c5ba2 (patch)
tree5c7db98db28505ae8d0814014d3b8754aadfae2c /iseq.c
parentc3900ff4a8179e7bc8bbd75e8970168a98e98ae4 (diff)
downloadruby-9871d88ee4b73bc4685f011b77b97228b03c5ba2.tar.gz
iseq.c: set coverage at once
* iseq.c (prepare_iseq_build): set coverage at once, not repeatedly resetting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/iseq.c b/iseq.c
index 3d1713c6be..e0a33d6288 100644
--- a/iseq.c
+++ b/iseq.c
@@ -267,6 +267,8 @@ prepare_iseq_build(rb_iseq_t *iseq,
const rb_iseq_t *parent, enum iseq_type type,
const rb_compile_option_t *option)
{
+ VALUE coverage = Qfalse;
+
iseq->body->type = type;
set_relation(iseq, parent);
@@ -296,15 +298,14 @@ prepare_iseq_build(rb_iseq_t *iseq,
ISEQ_COMPILE_DATA(iseq)->option = option;
ISEQ_COMPILE_DATA(iseq)->last_coverable_line = -1;
- ISEQ_COVERAGE_SET(iseq, Qfalse);
-
if (!GET_THREAD()->parse_in_eval) {
VALUE coverages = rb_get_coverages();
if (RTEST(coverages)) {
- ISEQ_COVERAGE_SET(iseq, rb_hash_lookup(coverages, path));
- if (NIL_P(ISEQ_COVERAGE(iseq))) ISEQ_COVERAGE_SET(iseq, Qfalse);
+ coverage = rb_hash_lookup(coverages, path);
+ if (NIL_P(coverage)) coverage = Qfalse;
}
}
+ ISEQ_COVERAGE_SET(iseq, coverage);
return Qtrue;
}