Commit f25897cd authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2282 from yui-knk/check-before-malloc

Change range_check before mrb_obj_alloc.
parents c52838ca 1f3957af
...@@ -38,8 +38,8 @@ mrb_range_new(mrb_state *mrb, mrb_value beg, mrb_value end, mrb_bool excl) ...@@ -38,8 +38,8 @@ mrb_range_new(mrb_state *mrb, mrb_value beg, mrb_value end, mrb_bool excl)
{ {
struct RRange *r; struct RRange *r;
r = (struct RRange*)mrb_obj_alloc(mrb, MRB_TT_RANGE, RANGE_CLASS);
range_check(mrb, beg, end); range_check(mrb, beg, end);
r = (struct RRange*)mrb_obj_alloc(mrb, MRB_TT_RANGE, RANGE_CLASS);
r->edges = (mrb_range_edges *)mrb_malloc(mrb, sizeof(mrb_range_edges)); r->edges = (mrb_range_edges *)mrb_malloc(mrb, sizeof(mrb_range_edges));
r->edges->beg = beg; r->edges->beg = beg;
r->edges->end = end; r->edges->end = end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment