diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-01 16:36:47 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-01 16:36:47 +0000 |
commit | 63aa00cb085cca1f2992d09cddc78014ffea82dd (patch) | |
tree | a1c4821bc01aa1a3b81cbbfb5d2861651eb7bbaf | |
parent | f5a7147634b1369a8c0bc79d2d46e4a8285804a0 (diff) | |
download | ruby-63aa00cb085cca1f2992d09cddc78014ffea82dd.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | eval.c | 7 |
2 files changed, 14 insertions, 3 deletions
@@ -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 @@ -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(); |