1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_f_block_given_p): real required condition is

ruby_frame->prev->iter == ITER_CUR.

* eval.c (rb_block_given_p): ditto.

* eval.c (block_pass): update ruby_frame->iter only when previous
  value is ITER_NOT.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-10-01 16:36:47 +00:00
parent f5a7147634
commit 63aa00cb08
2 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,13 @@
Thu Oct 2 01:32:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_f_block_given_p): real required condition is
ruby_frame->prev->iter == ITER_CUR.
* eval.c (rb_block_given_p): ditto.
* eval.c (block_pass): update ruby_frame->iter only when previous
value is ITER_NOT.
Thu Oct 2 01:02:35 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* variable.c (rb_const_defined_at): should exclude constants from

7
eval.c
View file

@ -4002,7 +4002,7 @@ rb_jump_tag(tag)
int
rb_block_given_p()
{
if (ruby_frame->iter && ruby_block)
if (ruby_frame->iter == ITER_CUR && ruby_block)
return Qtrue;
return Qfalse;
}
@ -4016,7 +4016,7 @@ rb_iterator_p()
static VALUE
rb_f_block_given_p()
{
if (ruby_frame->prev && ruby_frame->prev->iter && ruby_block)
if (ruby_frame->prev && ruby_frame->prev->iter == ITER_CUR && ruby_block)
return Qtrue;
return Qfalse;
}
@ -7244,7 +7244,8 @@ block_pass(self, node)
_block.outer = ruby_block;
ruby_block = &_block;
PUSH_ITER(ITER_PRE);
ruby_frame->iter = ITER_PRE;
if (ruby_frame->iter == ITER_NOT)
ruby_frame->iter = ITER_PRE;
PUSH_TAG(PROT_ITER);
state = EXEC_TAG();