Backport #8540

Ruby crashes when sending "attr="

Added by Justin Woodbridge 10 months ago. Updated 10 months ago.

[ruby-core:55543]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

Description

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)
Actual: crashes

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)

Associated revisions

Revision 41395
Added by Tomoyuki Chikanaga 10 months ago

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]

History

#1 Updated by Charlie Somerville 10 months ago

  • Assignee set to Charlie Somerville

#2 Updated by Charlie Somerville 10 months ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Fixed in r41389, accidentally omitted the bug number from the commit message.

#3 Updated by Tomoyuki Chikanaga 10 months ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport200
  • Status changed from Closed to Assigned
  • Assignee changed from Charlie Somerville to Tomoyuki Chikanaga

#4 Updated by Tomoyuki Chikanaga 10 months 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]

Also available in: Atom PDF