Ruby crashes when sending "attr="
Ruby crashes when trying to run: obj.send "attr=" where attr= is a method defined by attr_accessor. Only happens when no argument is provided.
Expected: wrong number of arguments (0 for 1) (ArgumentError)
Code sample and crash logs: https://gist.github.com/woodbridge/5805212 .
Ruby Versions: 2.0.0-p0, 2.0.0-p195, and rev 4ff3b.
Systems: Mac OS X 10.8.2 (x86_64)
#4 Updated by Tomoyuki Chikanaga almost 3 years ago
- Status changed from Assigned to Closed
This issue was solved with changeset r41395.
Justin, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
merge revision(s) 41389: [Backport #8540]
* vm_insnhelper.c (vm_call_method): ensure methods of type VM_METHOD_TYPE_ATTR_SET are called with 1 argument * test/ruby/test_module.rb (class TestModule): add test [Bug #8540]