summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-25 18:22:58 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-25 18:22:58 +0000
commitf53d8254474628f0c3710950ee342ecf941f2fd1 (patch)
treeaf5ceb44bbe0884aff93af7a64f5638e72af139d /eval.c
parent6ebdbb30add7acc3edc49bc910c4931e5125fb10 (diff)
* cont.c, vm_core.h, eval.c: because rb_protect must not be jumped by
callcc, revert r26407. And rename trap_tag to protect_tag and change exception message (across trap -> across stack rewinding barrier). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index ffc924edce..6deed9cd30 100644
--- a/eval.c
+++ b/eval.c
@@ -690,14 +690,19 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
int status;
rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th->cfp;
+ struct rb_vm_protect_tag protect_tag;
rb_jmpbuf_t org_jmpbuf;
+ protect_tag.prev = th->protect_tag;
+
PUSH_TAG();
+ th->protect_tag = &protect_tag;
MEMCPY(&org_jmpbuf, &(th)->root_jmpbuf, rb_jmpbuf_t, 1);
if ((status = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, result = (*proc) (data));
}
MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
+ th->protect_tag = protect_tag.prev;
POP_TAG();
if (state) {