summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-16 12:14:41 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-16 12:14:41 +0000
commit81d5b699812dab4048543da77a40372bd4b4045c (patch)
tree843ceddbc381e0ec03547e79b224622c26c471a7 /parse.y
parent4142e34eb17d45450d3f2792f2634e1f5ffb9c9c (diff)
merge revision(s) 53424,55509: [Backport #12517]
* test/coverage/test_coverage.rb: ignored test when enabled to coverage. It lead to crash with `make test-all`. * 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/branches/ruby_2_2@55943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 68ef4e9cee..fcf9b52814 100644
--- a/parse.y
+++ b/parse.y
@@ -5454,7 +5454,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;
}