diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-18 05:07:07 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-18 05:07:07 +0000 |
| commit | 8a100acfeb09cf513c05d8b23836aecb3f5f3954 (patch) | |
| tree | 2a84bdbf5bf118bc4f08bbe3e962425dc3a7705c | |
| parent | 7e1abb20c0799a7e8b7fa5987c506543509ecf32 (diff) | |
| download | ruby-8a100acfeb09cf513c05d8b23836aecb3f5f3954.tar.gz ruby-8a100acfeb09cf513c05d8b23836aecb3f5f3954.tar.xz ruby-8a100acfeb09cf513c05d8b23836aecb3f5f3954.zip | |
* compile.c (iseq_compile_each): fix to allow self.x=
if x= is private.
* bootstraptest/test_method.rb: add a test for above.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | bootstraptest/test_method.rb | 10 | ||||
| -rw-r--r-- | compile.c | 1 |
3 files changed, 18 insertions, 0 deletions
@@ -1,3 +1,10 @@ +Sat Aug 18 13:55:58 2007 Koichi Sasada <ko1@atdot.net> + + * compile.c (iseq_compile_each): fix to allow self.x= + if x= is private. + + * bootstraptest/test_method.rb: add a test for above. + Sat Aug 18 14:05:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> * parse.y (reg_compile_gen): obtain error info from errinfo. diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb index 28fee41d1..9a59b63d5 100644 --- a/bootstraptest/test_method.rb +++ b/bootstraptest/test_method.rb @@ -906,3 +906,13 @@ assert_equal %q{[:ok, :ok, :ok, :ok, :ok, :ok, :ng, :ng]}, %q{ $ans } +assert_equal 'ok', %q{ + class C + def x=(n) + end + def m + self.x = :ok + end + end + C.new.m +} @@ -4359,6 +4359,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) argc = setup_args(iseq, args, node->nd_args, &flag); if (node->nd_recv == (NODE *) 1) { + flag |= VM_CALL_FCALL_BIT; ADD_INSN(recv, nd_line(node), putself); } else { |
