diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-06 08:33:05 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-06 08:33:05 +0000 |
commit | 22468a4f92c7fa7a08e53a674285183b1af49ed4 (patch) | |
tree | e6c926648d65e0af7ece1c32089647bd4fa186f1 /insns.def | |
parent | 8ea8dfd88cab357bc65c11e993d14e881a31b776 (diff) |
* vm_insnhelper.c (vm_push_frame): fix stack overflow check codes.
Stack overflow check should be done *after* pushing a stack frame.
However, some stack overflow checking codes checked *before*
pushing a stack frame with iseq->stack_max.
To solve this problem, add a new parameter `stack_max' to specify
a possible consuming stack size.
* vm_core.h (CHECK_VM_STACK_OVERFLOW0): add to share the stack overflow
checking code.
* insns.def: catch up this change.
* vm.c, vm_eval.c: ditto.
* test/ruby/test_exception.rb: add a stack overflow test.
This code is reported by nobu.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -972,7 +972,7 @@ defineclass vm_push_frame(th, class_iseq, VM_FRAME_MAGIC_CLASS, klass, 0, VM_ENVVAL_BLOCK_PTR(GET_BLOCK_PTR()), class_iseq->iseq_encoded, GET_SP(), - class_iseq->local_size, 0); + class_iseq->local_size, 0, class_iseq->stack_max); RESTORE_REGS(); INC_VM_STATE_VERSION(); |