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

* vm.c (vm_set_eval_stack, vm_set_main_stack, vm_set_top_stack):

check stack overflow.  [ruby-dev:37646]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2008-12-29 07:44:56 +00:00
parent 6dd1910a3d
commit 272a3aa6a2
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Mon Dec 29 16:16:20 2008 Koichi Sasada <ko1@atdot.net>
* vm.c (vm_set_eval_stack, vm_set_main_stack, vm_set_top_stack):
check stack overflow. [ruby-dev:37646]
Sun Dec 28 18:36:33 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* test/rubygems/test_gem_command.rb

6
vm.c
View file

@ -77,6 +77,8 @@ vm_set_top_stack(rb_thread_t * th, VALUE iseqval)
vm_push_frame(th, iseq, VM_FRAME_MAGIC_TOP,
th->top_self, 0, iseq->iseq_encoded,
th->cfp->sp, 0, iseq->local_size);
CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
}
static void
@ -95,6 +97,8 @@ vm_set_eval_stack(rb_thread_t * th, VALUE iseqval, const NODE *cref)
if (cref) {
th->cfp->dfp[-1] = (VALUE)cref;
}
CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
}
static void
@ -116,6 +120,8 @@ vm_set_main_stack(rb_thread_t *th, VALUE iseqval)
if (bind && iseq->local_size > 0) {
bind->env = vm_make_env_object(th, th->cfp);
}
CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
}
rb_control_frame_t *