From 10fecc237573b1d3ed81e8d355401dab4deb19bd Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Sat, 7 Sep 2013 20:17:39 +0900 Subject: fix line getting handler of line_ary --- src/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/debug.c') diff --git a/src/debug.c b/src/debug.c index 7902c09ba..8e4311f6c 100644 --- a/src/debug.c +++ b/src/debug.c @@ -73,8 +73,8 @@ mrb_debug_get_line(mrb_irep *irep, uint32_t pc) else if ((f = get_file(irep->debug_info, pc))) { switch(f->line_type) { case mrb_debug_line_ary: - mrb_assert(pc < (f->start_pos + f->line_entry_count)); - return f->line_ary[pc]; + mrb_assert(f->start_pos <= pc && pc < (f->start_pos + f->line_entry_count)); + return f->line_ary[pc - f->start_pos]; case mrb_debug_line_flat_map: { // get upper bound -- cgit v1.2.3