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

* vm_eval.c (eval_string_with_cref): use rb_vm_get_ruby_level_next_cfp()

instead of vm_get_ruby_level_caller_cfp().  checking a upper frame
  is not enough.  [ruby-dev:37984]
* proc.c, vm_core.h: declare rb_vm_get_ruby_level_next_cfp()
  on vm_core.h.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2009-02-13 06:25:59 +00:00
parent c5d7d78dae
commit 0cb68b619e
4 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,12 @@
Fri Feb 13 15:11:11 2009 Koichi Sasada <ko1@atdot.net>
* vm_eval.c (eval_string_with_cref): use rb_vm_get_ruby_level_next_cfp()
instead of vm_get_ruby_level_caller_cfp(). checking a upper frame
is not enough. [ruby-dev:37984]
* proc.c, vm_core.h: declare rb_vm_get_ruby_level_next_cfp()
on vm_core.h.
Fri Feb 13 15:01:40 2009 Koichi Sasada <ko1@atdot.net> Fri Feb 13 15:01:40 2009 Koichi Sasada <ko1@atdot.net>
* cont.c (rb_fiber_alive_p): fix to return true instead of 1. * cont.c (rb_fiber_alive_p): fix to return true instead of 1.

2
proc.c
View file

@ -274,8 +274,6 @@ binding_clone(VALUE self)
return bindval; return bindval;
} }
rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, rb_control_frame_t *cfp);
VALUE VALUE
rb_binding_new(void) rb_binding_new(void)
{ {

View file

@ -593,6 +593,7 @@ int ruby_thread_has_gvl_p(void);
VALUE rb_make_backtrace(void); VALUE rb_make_backtrace(void);
typedef int rb_backtrace_iter_func(void *, const char *, int, const char *); typedef int rb_backtrace_iter_func(void *, const char *, int, const char *);
VALUE rb_backtrace_each(rb_backtrace_iter_func *iter, void *arg); VALUE rb_backtrace_each(rb_backtrace_iter_func *iter, void *arg);
rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, rb_control_frame_t *cfp);
NOINLINE(void rb_gc_save_machine_context(rb_thread_t *)); NOINLINE(void rb_gc_save_machine_context(rb_thread_t *));

View file

@ -706,7 +706,7 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
th->base_block = &env->block; th->base_block = &env->block;
} }
else { else {
rb_control_frame_t *cfp = vm_get_ruby_level_caller_cfp(th, th->cfp); rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
if (cfp != 0) { if (cfp != 0) {
block = *RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp); block = *RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp);