* vm_insnhelper.c (vm_push_frame): get rid of out-of-bounds

access.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-11-07 11:59:16 +00:00
parent ddc4143af0
commit 52ebc24487
4 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Sat Nov 7 20:59:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_insnhelper.c (vm_push_frame): get rid of out-of-bounds
access.
Sat Nov 7 12:41:19 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* vm_insnhelper.c (VM_CALLEE_SETUP_ARG): revert r25521.

1
eval.c
View File

@ -15,6 +15,7 @@
#include "iseq.h"
#include "gc.h"
#include "ruby/vm.h"
#include "ruby/encoding.h"
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))

View File

@ -29,7 +29,9 @@ vm_push_frame(rb_thread_t * th, const rb_iseq_t * iseq,
rb_control_frame_t * const cfp = th->cfp - 1;
int i;
CHECK_STACK_OVERFLOW(th->cfp, local_size);
if ((void *)(sp + local_size) >= (void *)cfp) {
rb_exc_raise(sysstack_error);
}
th->cfp = cfp;
/* setup vm value stack */