summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-20 17:22:27 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-20 17:22:27 +0000
commit0347d29810521261d12959fde5a49eadc33e5f0b (patch)
tree7fdb9c1bd9bbee6399f8372ba6c6613b0d9aef0f /eval.c
parentff75ab3e3cd76b1b457661edf6b20661d45c8d78 (diff)
* eval.c (proc_invoke): should not propagate TAG_BREAK and
TAG_RETURN from orphan Proc object. [ruby-core:01148] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index de1d9b9..c4cd1ac 100644
--- a/eval.c
+++ b/eval.c
@@ -6940,7 +6940,7 @@ proc_invoke(proc, args, self, klass)
volatile int safe = ruby_safe_level;
volatile VALUE old_wrapper = ruby_wrapper;
struct RVarmap * volatile old_dvars = ruby_dyna_vars;
- int pcall;
+ volatile int pcall;
if (rb_block_given_p() && ruby_frame->last_func) {
rb_warning("block for %s#%s is useless",
@@ -6973,7 +6973,7 @@ proc_invoke(proc, args, self, klass)
POP_ITER();
incoming_state = state;
- if (ruby_block->tag->dst == state) {
+ if (orphan || ruby_block->tag->dst == state) {
state &= TAG_MASK;
}
ruby_block = old_block;
@@ -6986,7 +6986,7 @@ proc_invoke(proc, args, self, klass)
break;
case TAG_RETRY:
if (pcall || orphan) {
- localjump_error("retry from block-closure", Qnil, state);
+ localjump_error("retry from proc-closure", Qnil, state);
}
/* fall through */
case TAG_BREAK:
@@ -6996,7 +6996,7 @@ proc_invoke(proc, args, self, klass)
}
else if (orphan) { /* orphan block */
char mesg[32];
- snprintf(mesg, sizeof mesg, "%s from block-closure",
+ snprintf(mesg, sizeof mesg, "%s from proc-closure",
state == TAG_BREAK ? "break" : "return");
localjump_error(mesg, prot_tag->retval, state);
}
@@ -7006,7 +7006,7 @@ proc_invoke(proc, args, self, klass)
}
break;
default:
- JUMP_TAG(state);
+ JUMP_TAG(incoming_state);
}
return result;
}