mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
ff75ab3e3c
commit
0347d29810
2 changed files with 10 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Jun 20 23:28:27 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (proc_invoke): should not propagate TAG_BREAK and
|
||||
TAG_RETURN from orphan Proc object. [ruby-core:01148]
|
||||
|
||||
Fri Jun 20 15:04:28 2003 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* defines.h (PATH_ENV): name of PATH environment. [new].
|
||||
|
|
10
eval.c
10
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue