Skip to content

Commit

Permalink
eval_error.c: fix off-by-one error for --backtrace-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Dec 21, 2020
1 parent ac78d90 commit eee93bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eval_error.c
Expand Up @@ -253,9 +253,9 @@ print_backtrace(const VALUE eclass, const VALUE errat, const VALUE str, int reve
}

// skip for explicit limit
if (rb_backtrace_length_limit >= 0 && len > rb_backtrace_length_limit + 1) {
if (rb_backtrace_length_limit >= 0 && len > rb_backtrace_length_limit + 2) {
skip_start = rb_backtrace_length_limit + 1;
skip_len = len - rb_backtrace_length_limit;
skip_len = len - skip_start;
}

for (i = 1; i < len; i++) {
Expand Down

0 comments on commit eee93bc

Please sign in to comment.