diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-14 12:56:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-14 12:56:46 +0000 |
commit | e72ae8cc0fe471b5426c7babbcf8f7191f3b6d48 (patch) | |
tree | 0e6eefa6db5e8ff676ca09090346510c3a9c5ed7 /iseq.c | |
parent | 3772335ae6dad3f65ad42cf5986068a4a7293141 (diff) | |
download | ruby-e72ae8cc0fe471b5426c7babbcf8f7191f3b6d48.tar.gz |
* iseq.c (iseq_data_to_ary): check line info table boundary. line
number 0 means no line number info is needed. [ruby-dev:45130]
[Bug #5894]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1104,7 +1104,8 @@ cdhash_each(VALUE key, VALUE value, VALUE ary) static VALUE iseq_data_to_ary(rb_iseq_t *iseq) { - long i, ti; + long i; + size_t ti; unsigned int pos; unsigned int line = 0; VALUE *seq; @@ -1315,7 +1316,7 @@ iseq_data_to_ary(rb_iseq_t *iseq) rb_ary_push(body, (VALUE)label); } - if (iseq->line_info_table[ti].position == pos) { + if (iseq->line_info_size < ti && iseq->line_info_table[ti].position == pos) { line = iseq->line_info_table[ti].line_no; rb_ary_push(body, INT2FIX(line)); ti++; |