mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #3345 from clayton-shopify/fix-range-beg-len
Check type before calling mrb_range_ptr.
This commit is contained in:
+2
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user