aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-26 23:56:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-26 23:56:57 +0000
commit2d76389f89c26c52d552abfa3b4ff5d795cd0aad (patch)
tree370e82beffde532917781711cabb6c6a9c0b2426 /compile.c
parentd568088ca9f62959b7b89caeac196595fa2b645a (diff)
downloadruby-2d76389f89c26c52d552abfa3b4ff5d795cd0aad.tar.gz
Coverage on non-positive lines
* compile.c (ADD_TRACE): ignore trace instruction on non-positive line. * parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index cc496cbab8..33e0ba37f6 100644
--- a/compile.c
+++ b/compile.c
@@ -253,6 +253,7 @@ r_value(VALUE value)
#define ADD_TRACE(seq, line, event) \
do { \
if ((event) == RUBY_EVENT_LINE && ISEQ_COVERAGE(iseq) && \
+ (line) > 0 && \
(line) != ISEQ_COMPILE_DATA(iseq)->last_coverable_line) { \
RARRAY_ASET(ISEQ_COVERAGE(iseq), (line) - 1, INT2FIX(0)); \
ISEQ_COMPILE_DATA(iseq)->last_coverable_line = (line); \