summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-25 09:55:35 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-25 09:55:35 +0000
commit74bbac68df669e77f1ccc5780bb1e9fc3df13d03 (patch)
treec6a53be3d40349ce0d34f680dfa941d9eebe0380 /vm_insnhelper.c
parent987bb11dc7ade805fcce0a54d78c0839e7a50e2b (diff)
merges r20967 from trunk into ruby_1_9_1.
* vm_insnhelper.c (vm_call_method): use class of method defined instead of receiver's class on bmethod. fixes [ruby-core:20786] * bootstraptest/test_method.rb: add a test for above. * vm_insnhelper.c (vm_setup_method): remove unused parameter klass. * vm_insnhelper.h (CALL_METHOD): ditto. * insns.def, vm_eval.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index a57c087c6f..0a2ecfa12e 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -423,7 +423,7 @@ vm_method_missing(rb_thread_t *th, ID id, VALUE recv,
static inline void
vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp,
const int argc, const rb_block_t *blockptr, const VALUE flag,
- const VALUE iseqval, const VALUE recv, const VALUE klass)
+ const VALUE iseqval, const VALUE recv)
{
rb_iseq_t *iseq;
int opt_pc, i;
@@ -479,7 +479,7 @@ vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp,
static inline VALUE
vm_call_method(rb_thread_t * const th, rb_control_frame_t * const cfp,
const int num, rb_block_t * const blockptr, const VALUE flag,
- const ID id, const NODE * mn, const VALUE recv, VALUE klass)
+ const ID id, const NODE * mn, const VALUE recv)
{
VALUE val;
@@ -496,7 +496,7 @@ vm_call_method(rb_thread_t * const th, rb_control_frame_t * const cfp,
switch (nd_type(node)) {
case RUBY_VM_METHOD_NODE:{
- vm_setup_method(th, cfp, num, blockptr, flag, (VALUE)node->nd_body, recv, klass);
+ vm_setup_method(th, cfp, num, blockptr, flag, (VALUE)node->nd_body, recv);
return Qundef;
}
case NODE_CFUNC:{
@@ -521,10 +521,11 @@ vm_call_method(rb_thread_t * const th, rb_control_frame_t * const cfp,
VALUE *argv = ALLOCA_N(VALUE, num);
MEMCPY(argv, cfp->sp - num, VALUE, num);
cfp->sp += - num - 1;
- val = vm_call_bmethod(th, id, node->nd_cval, recv, klass, num, argv, blockptr);
+ val = vm_call_bmethod(th, id, node->nd_cval, recv, mn->nd_clss, num, argv, blockptr);
break;
}
case NODE_ZSUPER:{
+ VALUE klass;
klass = RCLASS_SUPER(mn->nd_clss);
mn = rb_method_node(klass, id);