Actions
Bug #12517
closeddef_delegators broken on ruby-head?
Description
I found the following issue:
https://travis-ci.org/ioquatix/build-files/jobs/140181966
/home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:200:in `compile': negative array size (or size too big) (ArgumentError)
from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:200:in `_delegator_method'
from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:178:in `def_instance_delegator'
from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:154:in `block in def_instance_delegators'
from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:153:in `each'
from /home/travis/.rvm/rubies/ruby-head/lib/ruby/2.4.0/forwardable.rb:153:in `def_instance_delegators'
from /home/travis/build/ioquatix/build-files/lib/build/files/state.rb:71:in `<class:State>'
This is caused by the following line:
class State < Files::List
extend Forwardable
def_delegators :@files, :each, :roots, :count
It was fine in 2.3.0 and before.
Updated by nobu (Nobuyoshi Nakada) over 8 years ago
- Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED
- Description updated (diff)
- Status changed from Open to Feedback
Could you show a small code to reproduce?
Updated by nobu (Nobuyoshi Nakada) over 8 years ago
I couldn't reproduce it with r55504 on OS X 11.11.5 and Ubuntu 16.04.
Updated by akhramov (Artem Khramov) over 8 years ago
Here's the repro (OS X 10.11.5 / FreeBSD 10.2):
require 'coverage'
require 'forwardable'
Coverage.start
class Fail
extend Forwardable
def_delegator :foo, :bar
end
Updated by nobu (Nobuyoshi Nakada) over 8 years ago
- Backport changed from 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
Thanks!
Updated by nobu (Nobuyoshi Nakada) over 8 years ago
- Status changed from Feedback to Closed
Applied in changeset r55509.
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]
Updated by ioquatix (Samuel Williams) over 8 years ago
Thanks everyone that was so fast I blinked and missed it :D
Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago
- Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE
ruby_2_3 r55917 merged revision(s) 53424,55509.
Updated by usa (Usaku NAKAMURA) over 8 years ago
- Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE to 2.1: REQUIRED, 2.2: DONE, 2.3: DONE
ruby_2_2 r55943 merged revision(s) 53424,55509.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0