* insnhelper.ci (vm_call_bmethod),
vm.c (vm_invoke_proc_core): fix to do not restore $SAFE when proc invoked by bmethod. * vm_core.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
115a3d21e4
commit
2c5ae0eeba
@ -1,3 +1,11 @@
|
|||||||
|
Sat Aug 18 16:44:15 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* insnhelper.ci (vm_call_bmethod),
|
||||||
|
vm.c (vm_invoke_proc_core): fix to do not restore
|
||||||
|
$SAFE when proc invoked by bmethod.
|
||||||
|
|
||||||
|
* vm_core.h: ditto.
|
||||||
|
|
||||||
Sat Aug 18 16:44:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Aug 18 16:44:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* eval_error.ci (ruby_error_print): call error_print.
|
* eval_error.ci (ruby_error_print): call error_print.
|
||||||
|
@ -388,7 +388,7 @@ vm_call_bmethod(rb_thread_t *th, ID id, VALUE procval, VALUE recv,
|
|||||||
(cfp-2)->method_klass = klass;
|
(cfp-2)->method_klass = klass;
|
||||||
|
|
||||||
GetProcPtr(procval, proc);
|
GetProcPtr(procval, proc);
|
||||||
val = vm_invoke_proc(th, proc, recv, argc, argv);
|
val = vm_invoke_proc_core(th, proc, recv, argc, argv, 0);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
vm.c
16
vm.c
@ -606,8 +606,8 @@ vm_yield(rb_thread_t *th, int argc, VALUE *argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc,
|
vm_invoke_proc_core(rb_thread_t *th, rb_proc_t *proc,
|
||||||
VALUE self, int argc, VALUE *argv)
|
VALUE self, int argc, VALUE *argv, int restore_safe)
|
||||||
{
|
{
|
||||||
VALUE val = Qundef;
|
VALUE val = Qundef;
|
||||||
int state;
|
int state;
|
||||||
@ -623,7 +623,10 @@ vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc,
|
|||||||
}
|
}
|
||||||
TH_POP_TAG();
|
TH_POP_TAG();
|
||||||
|
|
||||||
th->safe_level = stored_safe;
|
if (restore_safe) {
|
||||||
|
th->safe_level = stored_safe;
|
||||||
|
}
|
||||||
|
|
||||||
lfp_set_special_cref(proc->block.lfp, (NODE*)stored_special_cref_stack);
|
lfp_set_special_cref(proc->block.lfp, (NODE*)stored_special_cref_stack);
|
||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
@ -647,6 +650,13 @@ vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc,
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc,
|
||||||
|
VALUE self, int argc, VALUE *argv)
|
||||||
|
{
|
||||||
|
return vm_invoke_proc_core(th, proc, self, argc, argv, 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* special variable */
|
/* special variable */
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
|
@ -616,6 +616,7 @@ int rb_thread_method_id_and_klass(rb_thread_t *th, ID *idp, VALUE *klassp);
|
|||||||
|
|
||||||
VALUE vm_eval_body(rb_thread_t *th);
|
VALUE vm_eval_body(rb_thread_t *th);
|
||||||
VALUE vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self, int argc, VALUE *argv);
|
VALUE vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self, int argc, VALUE *argv);
|
||||||
|
VALUE vm_invoke_proc_core(rb_thread_t *th, rb_proc_t *proc, VALUE self, int argc, VALUE *argv, int restore_flag);
|
||||||
VALUE vm_make_proc(rb_thread_t *th, rb_control_frame_t *cfp, rb_block_t *block);
|
VALUE vm_make_proc(rb_thread_t *th, rb_control_frame_t *cfp, rb_block_t *block);
|
||||||
VALUE vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp);
|
VALUE vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp);
|
||||||
VALUE vm_backtrace(rb_thread_t *, int);
|
VALUE vm_backtrace(rb_thread_t *, int);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user