mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #2282 from yui-knk/check-before-malloc
Change range_check before mrb_obj_alloc.
This commit is contained in:
+1
-1
@@ -38,8 +38,8 @@ mrb_range_new(mrb_state *mrb, mrb_value beg, mrb_value end, mrb_bool excl)
|
||||
{
|
||||
struct RRange *r;
|
||||
|
||||
r = (struct RRange*)mrb_obj_alloc(mrb, MRB_TT_RANGE, RANGE_CLASS);
|
||||
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->beg = beg;
|
||||
r->edges->end = end;
|
||||
|
||||
Reference in New Issue
Block a user