summaryrefslogtreecommitdiffhomepage
path: root/src/range.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-01-29 05:35:15 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-01-29 05:35:15 -0800
commite18a9c0a56aebcee004cd039c97667b56106e6aa (patch)
treefca1f4d4a5c15ce55c7604e5208abdde47f06bf3 /src/range.c
parent14c97e824327fd103e81bd27907715c6e1a58b39 (diff)
parent7941dfb44a1c843c990d1ba0b65071e21f83520d (diff)
downloadmruby-e18a9c0a56aebcee004cd039c97667b56106e6aa.tar.gz
mruby-e18a9c0a56aebcee004cd039c97667b56106e6aa.zip
Merge pull request #788 from masamitsu-murase/modify_range_initialize
Modify range initialize to prevent segmentation fault.
Diffstat (limited to 'src/range.c')
-rw-r--r--src/range.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/range.c b/src/range.c
index 426695a94..2cdc34f5c 100644
--- a/src/range.c
+++ b/src/range.c
@@ -43,8 +43,8 @@ mrb_range_new(mrb_state *mrb, mrb_value beg, mrb_value end, int excl)
struct RRange *r;
r = (struct RRange*)mrb_obj_alloc(mrb, MRB_TT_RANGE, RANGE_CLASS);
- r->edges = (struct mrb_range_edges *)mrb_malloc(mrb, sizeof(struct mrb_range_edges));
range_check(mrb, beg, end);
+ r->edges = (struct mrb_range_edges *)mrb_malloc(mrb, sizeof(struct mrb_range_edges));
r->edges->beg = beg;
r->edges->end = end;
r->excl = excl;