Merge pull request #93 from k-tsj/fix-splat-segv

Fix SEGV caused by using the splat operator for non arrays
This commit is contained in:
Yukihiro "Matz" Matsumoto
2012-05-05 08:54:37 -07:00
+6 -1
View File
@@ -725,7 +725,12 @@ mrb_ary_rindex_m(mrb_state *mrb, mrb_value self)
mrb_value
mrb_ary_splat(mrb_state *mrb, mrb_value v)
{
return v;
if (mrb_type(v) == MRB_TT_ARRAY) {
return v;
}
else {
return mrb_ary_new_from_values(mrb, &v, 1);
}
}
static mrb_value