summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-17 07:47:59 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-17 07:47:59 +0000
commit874a344ed60bec033fb90d9c9748234df322fafe (patch)
tree7bf5e098f9ab57a8c2301f3d0e6544a820eb64ed /eval.c
parent0ce51bc995521f1c0c60d6b2409646ea7cde5ce7 (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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 36af45b6f4..4815717bee 100644
--- a/eval.c
+++ b/eval.c
@@ -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);