Skip to content

Commit f56c0c0

Browse files
committed
merge revision(s) 41389: [Backport ruby#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 [ruby-core:55543] [Bug ruby#8540] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 12f4488 commit f56c0c0

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Wed Jun 19 04:20:31 2013 Charlie Somerville <[email protected]>
2+
3+
* vm_insnhelper.c (vm_call_method): ensure methods of type
4+
VM_METHOD_TYPE_ATTR_SET are called with 1 argument
5+
6+
* test/ruby/test_module.rb (class TestModule): add test
7+
8+
[ruby-core:55543] [Bug #8540]
9+
110
Wed Jun 19 03:54:04 2013 Nobuyoshi Nakada <[email protected]>
211

312
* defs/id.def (predefined): add "idProc".

test/ruby/test_module.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,14 @@ def attr_accessor(*); super; end
11651165
assert_equal(1, c.x, bug3406)
11661166
end
11671167

1168+
def test_attr_writer_with_no_arguments
1169+
bug8540 = "[ruby-core:55543]"
1170+
c = Class.new do
1171+
attr_writer :foo
1172+
end
1173+
assert_raise(ArgumentError) { c.new.send :foo= }
1174+
end
1175+
11681176
def test_private_constant
11691177
c = Class.new
11701178
c.const_set(:FOO, "foo")

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.0.0"
22
#define RUBY_RELEASE_DATE "2013-06-19"
3-
#define RUBY_PATCHLEVEL 232
3+
#define RUBY_PATCHLEVEL 233
44

55
#define RUBY_RELEASE_YEAR 2013
66
#define RUBY_RELEASE_MONTH 6

vm_insnhelper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,7 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
17501750
CI_SET_FASTPATH(ci, vm_call_cfunc, enable_fastpath);
17511751
return vm_call_cfunc(th, cfp, ci);
17521752
case VM_METHOD_TYPE_ATTRSET:{
1753-
rb_check_arity(ci->argc, 0, 1);
1753+
rb_check_arity(ci->argc, 1, 1);
17541754
ci->aux.index = 0;
17551755
CI_SET_FASTPATH(ci, vm_call_attrset, enable_fastpath && !(ci->flag & VM_CALL_ARGS_SPLAT));
17561756
return vm_call_attrset(th, cfp, ci);

0 commit comments

Comments
 (0)