aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/iseq.c b/iseq.c
index 3030899d83..fd148dc1a2 100644
--- a/iseq.c
+++ b/iseq.c
@@ -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++;