Avoid possible data loss by using `ptrdiff_t`.
@@ -26,9 +26,9 @@ typedef void (*each_backtrace_func)(mrb_state*, int i, struct backtrace_location
static const mrb_data_type bt_type = { "Backtrace", mrb_free };
static void
-each_backtrace(mrb_state *mrb, mrb_int ciidx, mrb_code *pc0, each_backtrace_func func, void *data)
+each_backtrace(mrb_state *mrb, ptrdiff_t ciidx, mrb_code *pc0, each_backtrace_func func, void *data)
{
- int i, j;
+ ptrdiff_t i, j;
if (ciidx >= mrb->c->ciend - mrb->c->cibase)
ciidx = 10; /* ciidx is broken... */
