diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-21 08:37:46 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-21 08:37:46 +0000 |
commit | 416aa4591859f20ba4c86a139c4855f1c8ea56f1 (patch) | |
tree | 958dd9b80694c6e2fdc2078d7735c5dd72a38142 /vm_insnhelper.c | |
parent | e5ffa438f2475e70b7f53e56a0207970f56eb059 (diff) |
* vm_insnhelper.c (vm_invoke_block): we should not expect ci->argc is
stable after invoking a block. [Bug #11451]
* test/ruby/test_yield.rb: add a test. This test script is given by
Alex Dowad.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index d0ab1f34c5..a63a3f7758 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2336,10 +2336,11 @@ vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci } else { VALUE val; + int argc = ci->argc; CALLER_SETUP_ARG(th->cfp, ci); - val = vm_yield_with_cfunc(th, block, block->self, - ci->argc, STACK_ADDR_FROM_TOP(ci->argc), 0); - POPN(ci->argc); /* TODO: should put before C/yield? */ + + val = vm_yield_with_cfunc(th, block, block->self, argc, STACK_ADDR_FROM_TOP(argc), 0); + POPN(argc); /* TODO: should put before C/yield? */ return val; } } |