summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--vm.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 495934ac8b..e5183f7bf2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Dec 18 21:09:23 2007 Koichi Sasada <[email protected]>
+
+ * vm.c (invoke_block): merge 2 stack overflow checks.
+
Tue Dec 18 20:58:35 2007 Koichi Sasada <[email protected]>
* compile.c, insnhelper.ci, insns.def, object.c, vm.c, vm.h:
diff --git a/vm.c b/vm.c
index 79404a3fa4..29e23b4a6f 100644
--- a/vm.c
+++ b/vm.c
@@ -550,8 +550,7 @@ invoke_block(rb_thread_t *th, rb_block_t *block, VALUE self, int argc, VALUE *ar
rb_vm_set_finish_env(th);
- CHECK_STACK_OVERFLOW(th->cfp, argc);
- CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
+ CHECK_STACK_OVERFLOW(th->cfp, argc + iseq->stack_max);
for (i=0; i<argc; i++) {
th->cfp->sp[i] = argv[i];