summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 17:31:22 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 17:31:22 +0000
commit6851ad4756b676fa114e17bc805bc92bb6656caa (patch)
treeff94401e2f871a339697cc3af51b65f96ba87f86 /vm_insnhelper.c
parent4f74d59be995694a271b1a1a8e7bb45573db2c6d (diff)
* vm_insnhelper.c: attr_writer should return its argument [Bug #7773]
* test/ruby/test_basicinstructions.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index d82ffb3d1d..636cd39c2c 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -549,7 +549,7 @@ vm_getivar(VALUE obj, ID id, IC ic, rb_call_info_t *ci, int is_attr)
return rb_ivar_get(obj, id);
}
-static inline void
+static inline VALUE
vm_setivar(VALUE obj, ID id, VALUE val, IC ic, rb_call_info_t *ci, int is_attr)
{
#if USE_IC_FOR_IVAR
@@ -572,7 +572,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic, rb_call_info_t *ci, int is_attr)
if (index < len) {
ptr[index] = val;
- return; /* inline cache hit */
+ return val; /* inline cache hit */
}
}
else {
@@ -592,7 +592,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic, rb_call_info_t *ci, int is_attr)
}
}
#endif /* USE_IC_FOR_IVAR */
- rb_ivar_set(obj, id, val);
+ return rb_ivar_set(obj, id, val);
}
static VALUE
@@ -1540,9 +1540,9 @@ vm_call_ivar(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE
vm_call_attrset(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
{
- vm_setivar(ci->recv, ci->me->def->body.attr.id, *(cfp->sp - 1), 0, ci, 1);
+ VALUE val = vm_setivar(ci->recv, ci->me->def->body.attr.id, *(cfp->sp - 1), 0, ci, 1);
cfp->sp -= 2;
- return Qnil;
+ return val;
}
static inline VALUE