diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-29 07:44:56 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-29 07:44:56 +0000 |
commit | f82e50bba631cb1e063dafa1fea4eb09b3e2ebbe (patch) | |
tree | 340dbcc3c6220f335c4aeea20c77ee4281cbea98 /vm.c | |
parent | c5de6de83b1a4d2b9ab9fc00d6a8584f6828c422 (diff) | |
download | ruby-f82e50bba631cb1e063dafa1fea4eb09b3e2ebbe.tar.gz ruby-f82e50bba631cb1e063dafa1fea4eb09b3e2ebbe.tar.xz ruby-f82e50bba631cb1e063dafa1fea4eb09b3e2ebbe.zip |
* vm.c (vm_set_eval_stack, vm_set_main_stack, vm_set_top_stack):
check stack overflow. [ruby-dev:37646]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 * |