mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
+6
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user