diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-12 07:08:28 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-12 07:08:28 +0000 |
| commit | 1221b34f0f0c3fd462c4032be8fd2163b66cb614 (patch) | |
| tree | 0d378498a41ec7d477273854f0379c176002fd9f | |
| parent | 5ec50546b4bcd25a43116c45a33353f6fbc6833d (diff) | |
| download | ruby-1221b34f0f0c3fd462c4032be8fd2163b66cb614.tar.gz ruby-1221b34f0f0c3fd462c4032be8fd2163b66cb614.tar.xz ruby-1221b34f0f0c3fd462c4032be8fd2163b66cb614.zip | |
* eval.c (rb_protect): restore cfp ([ruby-dev:30671]).
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | eval.c | 4 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Thu Apr 12 16:06:48 2007 Koichi Sasada <ko1@atdot.net> + + * eval.c (rb_protect): restore cfp ([ruby-dev:30671]). + Thu Apr 12 16:04:31 2007 Koichi Sasada <ko1@atdot.net> * compile.c (iseq_compile_each): check node->nd_state == 1, not !0. @@ -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; } |
