diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-25 18:22:58 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-25 18:22:58 +0000 |
commit | f53d8254474628f0c3710950ee342ecf941f2fd1 (patch) | |
tree | af5ceb44bbe0884aff93af7a64f5638e72af139d /eval.c | |
parent | 6ebdbb30add7acc3edc49bc910c4931e5125fb10 (diff) | |
download | ruby-f53d8254474628f0c3710950ee342ecf941f2fd1.tar.gz |
* 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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) { |