1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* cont.c (rb_cont_call, cont_restore_1): remove trap_tag check because

it seems not to make sense.  [ruby-dev:40121]

* vm_core.h, eval.c (rb_protect): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-01-25 13:22:16 +00:00
parent 1d415019bd
commit 24f5161c39
4 changed files with 7 additions and 17 deletions

View file

@ -1,3 +1,10 @@
Mon Jan 25 22:08:20 2010 Yusuke Endoh <mame@tsg.ne.jp>
* cont.c (rb_cont_call, cont_restore_1): remove trap_tag check because
it seems not to make sense. [ruby-dev:40121]
* vm_core.h, eval.c (rb_protect): ditto.
Mon Jan 25 21:43:05 2010 Yusuke Endoh <mame@tsg.ne.jp> Mon Jan 25 21:43:05 2010 Yusuke Endoh <mame@tsg.ne.jp>
* test/ruby/envutil.rb: fix the check if instance method `ruby' is * test/ruby/envutil.rb: fix the check if instance method `ruby' is

7
cont.c
View file

@ -388,7 +388,6 @@ cont_restore_1(rb_context_t *cont)
th->state = sth->state; th->state = sth->state;
th->status = sth->status; th->status = sth->status;
th->tag = sth->tag; th->tag = sth->tag;
th->trap_tag = sth->trap_tag;
th->errinfo = sth->errinfo; th->errinfo = sth->errinfo;
th->first_proc = sth->first_proc; th->first_proc = sth->first_proc;
@ -621,9 +620,6 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
if (cont->saved_thread.self != th->self) { if (cont->saved_thread.self != th->self) {
rb_raise(rb_eRuntimeError, "continuation called across threads"); rb_raise(rb_eRuntimeError, "continuation called across threads");
} }
if (cont->saved_thread.trap_tag != th->trap_tag) {
rb_raise(rb_eRuntimeError, "continuation called across trap");
}
if (cont->saved_thread.fiber) { if (cont->saved_thread.fiber) {
rb_fiber_t *fcont; rb_fiber_t *fcont;
GetFiberPtr(cont->saved_thread.fiber, fcont); GetFiberPtr(cont->saved_thread.fiber, fcont);
@ -940,9 +936,6 @@ fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
if (cont->saved_thread.self != th->self) { if (cont->saved_thread.self != th->self) {
rb_raise(rb_eFiberError, "fiber called across threads"); rb_raise(rb_eFiberError, "fiber called across threads");
} }
else if (cont->saved_thread.trap_tag != th->trap_tag) {
rb_raise(rb_eFiberError, "fiber called across trap");
}
else if (fib->status == TERMINATED) { else if (fib->status == TERMINATED) {
value = rb_exc_new2(rb_eFiberError, "dead fiber called"); value = rb_exc_new2(rb_eFiberError, "dead fiber called");
if (th->fiber != fibval) rb_exc_raise(value); if (th->fiber != fibval) rb_exc_raise(value);

5
eval.c
View file

@ -690,19 +690,14 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
int status; int status;
rb_thread_t *th = GET_THREAD(); rb_thread_t *th = GET_THREAD();
rb_control_frame_t *cfp = th->cfp; rb_control_frame_t *cfp = th->cfp;
struct rb_vm_trap_tag trap_tag;
rb_jmpbuf_t org_jmpbuf; rb_jmpbuf_t org_jmpbuf;
trap_tag.prev = th->trap_tag;
PUSH_TAG(); PUSH_TAG();
th->trap_tag = &trap_tag;
MEMCPY(&org_jmpbuf, &(th)->root_jmpbuf, rb_jmpbuf_t, 1); MEMCPY(&org_jmpbuf, &(th)->root_jmpbuf, rb_jmpbuf_t, 1);
if ((status = EXEC_TAG()) == 0) { if ((status = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, result = (*proc) (data)); SAVE_ROOT_JMPBUF(th, result = (*proc) (data));
} }
MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1); MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
th->trap_tag = trap_tag.prev;
POP_TAG(); POP_TAG();
if (state) { if (state) {

View file

@ -347,10 +347,6 @@ struct rb_vm_tag {
struct rb_vm_tag *prev; struct rb_vm_tag *prev;
}; };
struct rb_vm_trap_tag {
struct rb_vm_trap_tag *prev;
};
#define RUBY_VM_VALUE_CACHE_SIZE 0x1000 #define RUBY_VM_VALUE_CACHE_SIZE 0x1000
#define USE_VALUE_CACHE 0 #define USE_VALUE_CACHE 0
@ -414,7 +410,6 @@ typedef struct rb_thread_struct
int transition_for_lock; int transition_for_lock;
struct rb_vm_tag *tag; struct rb_vm_tag *tag;
struct rb_vm_trap_tag *trap_tag;
int parse_in_eval; int parse_in_eval;
int mild_compile_error; int mild_compile_error;