From cc3871f9dcd8f89d6e554f59ff02c67dde42fc37 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 12 Apr 2007 07:08:28 +0000 Subject: [PATCH] * eval.c (rb_protect): restore cfp ([ruby-dev:30671]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ eval.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 17b92782d5..695a46ec6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Apr 12 16:06:48 2007 Koichi Sasada + + * eval.c (rb_protect): restore cfp ([ruby-dev:30671]). + Thu Apr 12 16:04:31 2007 Koichi Sasada * compile.c (iseq_compile_each): check node->nd_state == 1, not !0. diff --git a/eval.c b/eval.c index a96f9b8d9d..6291e19a09 100644 --- a/eval.c +++ b/eval.c @@ -1390,16 +1390,20 @@ rb_protect(VALUE (*proc) (VALUE), VALUE data, int *state) { VALUE result = Qnil; /* OK */ int status; + rb_thread_t *th = GET_THREAD(); + rb_control_frame_t *cfp = th->cfp; PUSH_THREAD_TAG(); if ((status = EXEC_TAG()) == 0) { result = (*proc) (data); } POP_THREAD_TAG(); + if (state) { *state = status; } if (status != 0) { + th->cfp = cfp; return Qnil; }