diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-28 09:39:43 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-28 09:39:43 +0000 |
commit | 51fee9065c9a5b5914ca0bc87e532a7c58b201fa (patch) | |
tree | db09e8856a62b07ed14308bf2ccbc9c4e359e3c2 /vm_insnhelper.c | |
parent | 65f52614c4272d733115d4ff2fa50a8505ce40ba (diff) | |
download | ruby-51fee9065c9a5b5914ca0bc87e532a7c58b201fa.tar.gz ruby-51fee9065c9a5b5914ca0bc87e532a7c58b201fa.tar.xz ruby-51fee9065c9a5b5914ca0bc87e532a7c58b201fa.zip |
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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 8 |
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:{ |