diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-17 07:47:59 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-17 07:47:59 +0000 |
commit | 874a344ed60bec033fb90d9c9748234df322fafe (patch) | |
tree | 7bf5e098f9ab57a8c2301f3d0e6544a820eb64ed /eval.c | |
parent | 0ce51bc995521f1c0c60d6b2409646ea7cde5ce7 (diff) |
* eval.c (rb_yield_0): should not clear state on TAG_NEXT when
it's invoked from within lambda body. [ruby-talk:248136]
* eval.c (proc_invoke): handle TAG_NEXT which would be caused by
next in the lambda body as well.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -5005,8 +5005,10 @@ rb_yield_0(val, self, klass, flags, avalue) CHECK_INTS; goto redo; case TAG_NEXT: - state = 0; - result = prot_tag->retval; + if (!lambda) { + state = 0; + result = prot_tag->retval; + } break; case TAG_BREAK: if (TAG_DST()) { @@ -8605,6 +8607,7 @@ proc_invoke(proc, args, self, klass) proc_jump_error(TAG_RETRY, Qnil); /* xxx */ JUMP_TAG(state); break; + case TAG_NEXT: case TAG_BREAK: if (!pcall && result != Qundef) { proc_jump_error(state, result); |