diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-26 23:56:57 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-26 23:56:57 +0000 |
commit | 2d76389f89c26c52d552abfa3b4ff5d795cd0aad (patch) | |
tree | 370e82beffde532917781711cabb6c6a9c0b2426 /parse.y | |
parent | d568088ca9f62959b7b89caeac196595fa2b645a (diff) | |
download | ruby-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 'parse.y')
-rw-r--r-- | parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5493,7 +5493,7 @@ coverage(VALUE fname, int n) { VALUE coverages = rb_get_coverages(); if (RTEST(coverages) && RBASIC(coverages)->klass == 0) { - VALUE lines = rb_ary_tmp_new_fill(n); + VALUE lines = n > 0 ? rb_ary_tmp_new_fill(n) : rb_ary_tmp_new(0); rb_hash_aset(coverages, fname, lines); return lines; } |