summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-28 09:39:43 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-28 09:39:43 +0000
commit1e8a6745b088100bfe6cc7f004e6dbd4558ad47c (patch)
treedb09e8856a62b07ed14308bf2ccbc9c4e359e3c2 /vm_insnhelper.c
parentc6252206717f4cfa376f9731b5535b12ea71fece (diff)
merges r21084 from trunk into ruby_1_9_1.
* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21113 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 28eaeb7951..3a13a0774e 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:{