summaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-27 03:57:21 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-27 03:57:21 +0000
commit45c6913042489b0aeb3ce6a38bb5e6e245e20807 (patch)
tree08400ea71783592d249227c384eeb28e85801bef /vm_insnhelper.c
parent3a67d33091fee43747ead2b7aa157337a05700bb (diff)
downloadruby-45c6913042489b0aeb3ce6a38bb5e6e245e20807.tar.gz
ruby-45c6913042489b0aeb3ce6a38bb5e6e245e20807.tar.xz
ruby-45c6913042489b0aeb3ce6a38bb5e6e245e20807.zip
* vm_insnhelper.c (vm_call_method, vm_call_cfunc): use original id instead of
calling id when NODE_CFUNC or NODE_BMETHOD. fixes Bug #632 [ruby-core:19282]. * vm_eval.c (vm_call0, vm_call_super): ditto. * vm_method.c (rb_add_method, rb_alias): store original id in nd_file field of NODE_METHOD. * test/stringio/test_stringio.rb: add a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 28eaeb795..3a13a0774 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -355,7 +355,7 @@ call_cfunc(VALUE (*func)(), VALUE recv,
static inline VALUE
vm_call_cfunc(rb_thread_t *th, rb_control_frame_t *reg_cfp,
- int num, ID id, VALUE recv, VALUE klass,
+ int num, ID id, ID oid, VALUE recv, VALUE klass,
VALUE flag, const NODE *mn, const rb_block_t *blockptr)
{
VALUE val;
@@ -366,7 +366,7 @@ vm_call_cfunc(rb_thread_t *th, rb_control_frame_t *reg_cfp,
vm_push_frame(th, 0, VM_FRAME_MAGIC_CFUNC,
recv, (VALUE) blockptr, 0, reg_cfp->sp, 0, 1);
- cfp->method_id = id;
+ cfp->method_id = oid;
cfp->method_class = klass;
reg_cfp->sp -= num + 1;
@@ -497,7 +497,7 @@ vm_call_method(rb_thread_t * const th, rb_control_frame_t * const cfp,
return Qundef;
}
case NODE_CFUNC:{
- val = vm_call_cfunc(th, cfp, num, id, recv, mn->nd_clss, flag, node, blockptr);
+ val = vm_call_cfunc(th, cfp, num, id, (ID)mn->nd_file, recv, mn->nd_clss, flag, node, blockptr);
break;
}
case NODE_ATTRSET:{
@@ -518,7 +518,7 @@ 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, mn->nd_clss, num, argv, blockptr);
+ val = vm_call_bmethod(th, (ID)mn->nd_file, node->nd_cval, recv, mn->nd_clss, num, argv, blockptr);
break;
}
case NODE_ZSUPER:{