summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-30 10:31:51 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-30 10:31:51 +0000
commit1453127367d35fe2b673245e1533d3a25f83d77b (patch)
tree33b5bb2d6d6a8b77059f73177cf780cd17b2e866 /vm.c
parente297c26dcae985299075acacfe8e25c93feb82ad (diff)
merges r21163 from trunk into ruby_1_9_1.
* 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/branches/ruby_1_9_1@21189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index ddb736c089..2469d5ea4e 100644
--- a/vm.c
+++ b/vm.c
@@ -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 *