aboutsummaryrefslogtreecommitdiffstats
path: root/struct.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 /struct.c
parent97628bff1211a6bc7bac53e75d0ceef64db3bc60 (diff)
downloadruby-e4717eaa4c7511f09e906b6896f15faab8ccec86.tar.gz
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 'struct.c')
-rw-r--r--struct.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/struct.c b/struct.c
index 080c0f3f04..c123318b81 100644
--- a/struct.c
+++ b/struct.c
@@ -13,8 +13,8 @@
#include "vm_core.h"
#include "method.h"
-VALUE rb_method_for_self_aref(VALUE name, VALUE arg);
-VALUE rb_method_for_self_aset(VALUE name, VALUE arg);
+VALUE rb_method_for_self_aref(VALUE name, VALUE arg, rb_insn_func_t func);
+VALUE rb_method_for_self_aset(VALUE name, VALUE arg, rb_insn_func_t func);
VALUE rb_cStruct;
static ID id_members;
@@ -175,7 +175,8 @@ new_struct(VALUE name, VALUE super)
static void
define_aref_method(VALUE nstr, VALUE name, VALUE off)
{
- VALUE iseqval = rb_method_for_self_aref(name, off);
+ rb_control_frame_t *FUNC_FASTCALL(rb_vm_opt_struct_aref)(rb_thread_t *, rb_control_frame_t *);
+ VALUE iseqval = rb_method_for_self_aref(name, off, rb_vm_opt_struct_aref);
rb_iseq_t *iseq = DATA_PTR(iseqval);
rb_add_method(nstr, SYM2ID(name), VM_METHOD_TYPE_ISEQ, iseq, NOEX_PUBLIC);
@@ -185,7 +186,8 @@ define_aref_method(VALUE nstr, VALUE name, VALUE off)
static void
define_aset_method(VALUE nstr, VALUE name, VALUE off)
{
- VALUE iseqval = rb_method_for_self_aset(name, off);
+ rb_control_frame_t *FUNC_FASTCALL(rb_vm_opt_struct_aset)(rb_thread_t *, rb_control_frame_t *);
+ VALUE iseqval = rb_method_for_self_aset(name, off, rb_vm_opt_struct_aset);
rb_iseq_t *iseq = DATA_PTR(iseqval);
rb_add_method(nstr, SYM2ID(name), VM_METHOD_TYPE_ISEQ, iseq, NOEX_PUBLIC);