diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-03 11:26:48 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-03 11:26:48 +0000 |
| commit | b34ded4d206f07fd76255a16755e38765a727ffc (patch) | |
| tree | 407db6355cceb12c3323b1c6eb152d08c112a994 | |
| parent | 611f941f11bc1d97227603c069c7336e4eaf8b66 (diff) | |
| download | ruby-b34ded4d206f07fd76255a16755e38765a727ffc.tar.gz ruby-b34ded4d206f07fd76255a16755e38765a727ffc.tar.xz ruby-b34ded4d206f07fd76255a16755e38765a727ffc.zip | |
* eval_jump.c (rb_f_catch): Resotre cfp if catched thrown object.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | eval_jump.c | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Thu Jan 3 20:24:48 2008 Koichi Sasada <ko1@atdot.net> + + * eval_jump.c (rb_f_catch): Resotre cfp if catched thrown object. + Thu Jan 3 19:45:57 2008 Koichi Sasada <ko1@atdot.net> * bootstraptest/test_eval.rb, test_knownbug.rb: move a fixed test. diff --git a/eval_jump.c b/eval_jump.c index 948ac635b..dbc3794a5 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; |
