summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-16 06:18:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-16 06:18:25 +0000
commite4717eaa4c7511f09e906b6896f15faab8ccec86 (patch)
tree32ab14152ca2230ee882f464194120cd22774dcb /vm_insnhelper.c
parent97628bff1211a6bc7bac53e75d0ceef64db3bc60 (diff)
iseq.c: struct accessors
* iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): call accessor functions directly, not to be affected by [] and []= methods. [ruby-core:66846] [Bug #10601] * struct.c (define_aref_method, define_aset_method): ditto. * vm_insnhelper.c (rb_vm_opt_struct_aref, rb_vm_opt_struct_aset): direct accessors of Struct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index edb0e0622d..d5314c7b67 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2107,3 +2107,16 @@ vm_once_clear(VALUE data)
return Qnil;
}
+rb_control_frame_t *
+FUNC_FASTCALL(rb_vm_opt_struct_aref)(rb_thread_t *th, rb_control_frame_t *reg_cfp)
+{
+ TOPN(0) = rb_struct_aref(GET_SELF(), TOPN(0));
+ return reg_cfp;
+}
+
+rb_control_frame_t *
+FUNC_FASTCALL(rb_vm_opt_struct_aset)(rb_thread_t *th, rb_control_frame_t *reg_cfp)
+{
+ rb_struct_aset(GET_SELF(), TOPN(0), TOPN(1));
+ return reg_cfp;
+}