diff options
| author | take_cheeze <[email protected]> | 2013-09-04 12:19:17 +0900 |
|---|---|---|
| committer | take_cheeze <[email protected]> | 2013-09-04 12:19:17 +0900 |
| commit | cc64e6e2b21373f6693f6aa903194cd1aece2cd6 (patch) | |
| tree | 67d805f006114c16cd48a8aa801fd842a832f9d3 /src/debug.c | |
| parent | 157a5529c5b9998933c22d916ec31aa1e11b6aaa (diff) | |
| download | mruby-cc64e6e2b21373f6693f6aa903194cd1aece2cd6.tar.gz mruby-cc64e6e2b21373f6693f6aa903194cd1aece2cd6.zip | |
add comment to mrb_assert in src/debug.c
Diffstat (limited to 'src/debug.c')
| -rw-r--r-- | src/debug.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/debug.c b/src/debug.c index 6e414674b..ebc8a319b 100644 --- a/src/debug.c +++ b/src/debug.c @@ -24,7 +24,9 @@ get_file(mrb_irep_debug_info* info, uint32_t const pc) --ret; + // check returning file exists inside debug info mrb_assert(info->files <= ret && ret < (info->files + info->flen)); + // check pc is within the range of returning file mrb_assert((*ret)->start_pos <= pc && pc < (((ret + 1 - info->files) < info->flen) ? (*(ret+1))->start_pos : info->pc_count)); @@ -89,7 +91,9 @@ mrb_debug_get_line(mrb_irep* irep, uint32_t const pc) --ret; + // check line entry pointer range mrb_assert(f->line_flat_map <= ret && ret < (f->line_flat_map + f->line_entry_count)); + // check pc range mrb_assert(ret->start_pos <= pc && pc < (((ret + 1 - f->line_flat_map) < f->line_entry_count) ? (ret+1)->start_pos : irep->debug_info->pc_count)); |
