summaryrefslogtreecommitdiffhomepage
path: root/src/debug.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-09-07 09:50:02 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2013-09-07 09:50:02 -0700
commit668a0466c551c5a04c1156f4597971f9e183d424 (patch)
treee98fb94d811819dc4be49a2f0affc41272328db2 /src/debug.c
parent385e5d6e831e0de76a44e736340bcb867df1d1a6 (diff)
parentaf73a740cdf7099bb25204d394e51275ad90db2d (diff)
downloadmruby-668a0466c551c5a04c1156f4597971f9e183d424.tar.gz
mruby-668a0466c551c5a04c1156f4597971f9e183d424.zip
Merge pull request #1500 from take-cheeze/debug_info_file_updating
Fix insufficient preparation to call mrb_debug_info_append_file.
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c4
1 files changed, 2 insertions, 2 deletions
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