diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-22 09:49:19 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-22 09:49:19 +0000 |
| commit | f66725171c224a11611f684567239b90819351af (patch) | |
| tree | 983ca8cd325837f7f8f61cb5b8239c724dc30f3c | |
| parent | ede8b08c6ea722d8452d625e7b685eb18ce5a126 (diff) | |
merges r23472 from trunk into ruby_1_9_1.
--
* vm.c (rb_vm_get_sourceline): should not access out of bound.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | version.h | 2 | ||||
| -rw-r--r-- | vm.c | 9 |
3 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,7 @@ +Sun May 17 13:15:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * vm.c (rb_vm_get_sourceline): should not access out of bound. + Sun May 17 09:31:05 2009 Masaki Suketa <masaki.suketa@nifty.ne.jp> * ext/win32ole/win32ole.c (foletypelib_name): should return @@ -1,6 +1,6 @@ #define RUBY_VERSION "1.9.1" #define RUBY_RELEASE_DATE "2009-05-12" -#define RUBY_PATCHLEVEL 148 +#define RUBY_PATCHLEVEL 149 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 @@ -672,11 +672,12 @@ rb_vm_get_sourceline(const rb_control_frame_t *cfp) const rb_iseq_t *iseq = cfp->iseq; if (RUBY_VM_NORMAL_ISEQ_P(iseq)) { - int i; - int pos = cfp->pc - cfp->iseq->iseq_encoded; + rb_num_t i; + size_t pos = cfp->pc - cfp->iseq->iseq_encoded; for (i = 0; i < iseq->insn_info_size; i++) { if (iseq->insn_info_table[i].position == pos) { + if (i == 0) goto found; line_no = iseq->insn_info_table[i - 1].line_no; goto found; } @@ -1462,7 +1463,7 @@ static VALUE *thread_recycle_stack_slot[RECYCLE_MAX]; static int thread_recycle_stack_count = 0; static VALUE * -thread_recycle_stack(int size) +thread_recycle_stack(size_t size) { if (thread_recycle_stack_count) { return thread_recycle_stack_slot[--thread_recycle_stack_count]; @@ -1675,7 +1676,7 @@ vm_define_method(rb_thread_t *th, VALUE obj, ID id, VALUE iseqval, { NODE *newbody; VALUE klass = cref->nd_clss; - int noex = cref->nd_visi; + int noex = (int)cref->nd_visi; rb_iseq_t *miseq; GetISeqPtr(iseqval, miseq); |
