Permalink
Browse files

Check type before calling mrb_range_ptr.

  • Loading branch information...
clayton-shopify committed Dec 13, 2016
1 parent fead715 commit 73ad7395c066c4ffbf9c082be6bb45b2214e9286
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/range.c
View
@@ -252,9 +252,10 @@ static mrb_bool
range_beg_len(mrb_state *mrb, mrb_value range, mrb_int *begp, mrb_int *lenp, mrb_int len, mrb_bool trunc)
{
mrb_int beg, end;
struct RRange *r = mrb_range_ptr(mrb, range);
struct RRange *r;
if (mrb_type(range) != MRB_TT_RANGE) return FALSE;
r = mrb_range_ptr(mrb, range);
beg = mrb_int(mrb, r->edges->beg);
end = mrb_int(mrb, r->edges->end);

0 comments on commit 73ad739

Please sign in to comment.