mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* eval.c (rb_block_pass): distinguish current block from others.
fixed: [ruby-dev:26274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
96d7c07e49
commit
3b602c7a74
2 changed files with 12 additions and 2 deletions
4
eval.c
4
eval.c
|
@ -947,6 +947,7 @@ static struct iter *ruby_iter;
|
|||
#define ITER_NOT 0
|
||||
#define ITER_PRE 1
|
||||
#define ITER_CUR 2
|
||||
#define ITER_PAS 3
|
||||
|
||||
#define PUSH_ITER(i) do { \
|
||||
struct iter _iter; \
|
||||
|
@ -5818,6 +5819,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
|
|||
|
||||
switch (ruby_iter->iter) {
|
||||
case ITER_PRE:
|
||||
case ITER_PAS:
|
||||
itr = ITER_CUR;
|
||||
break;
|
||||
case ITER_CUR:
|
||||
|
@ -8820,7 +8822,7 @@ rb_block_pass(func, arg, proc)
|
|||
}
|
||||
|
||||
if (ruby_block && ruby_block->block_obj == proc) {
|
||||
PUSH_ITER(ITER_PRE);
|
||||
PUSH_ITER(ITER_PAS);
|
||||
result = (*func)(arg);
|
||||
POP_ITER();
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue