summaryrefslogtreecommitdiff
path: root/eval_jump.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-03 11:26:48 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-03 11:26:48 +0000
commita0350e5964c1edba90bf6cf4bd7e2d5b64eaa386 (patch)
tree407db6355cceb12c3323b1c6eb152d08c112a994 /eval_jump.c
parent37d1059f49bb817234dcab8ddba69f7ebe5ba2cb (diff)
* eval_jump.c (rb_f_catch): Resotre cfp if catched thrown object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_jump.c')
-rw-r--r--eval_jump.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/eval_jump.c b/eval_jump.c
index 948ac635be..dbc3794a59 100644
--- a/eval_jump.c
+++ b/eval_jump.c
@@ -105,6 +105,7 @@ rb_f_catch(int argc, VALUE *argv)
int state;
VALUE val = Qnil; /* OK */
rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *saved_cfp = th->cfp;
rb_scan_args(argc, argv, "01", &tag);
if (argc == 0) {
@@ -118,6 +119,7 @@ rb_f_catch(int argc, VALUE *argv)
val = rb_yield_0(1, &tag);
}
else if (state == TAG_THROW && RNODE(th->errinfo)->u1.value == tag) {
+ th->cfp = saved_cfp;
val = th->tag->retval;
th->errinfo = Qnil;
state = 0;